Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor dubbo-samples-tengine #785

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 2-advanced/dubbo-samples-tengine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ git clone https://github.com/alibaba/tengine.git
```
cd ./tengine

wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
tar xvf pcre-8.43.tar.gz
wget https://sourceforge.net/projects/pcre/files/pcre/8.43/pcre-8.43.tar.gz/download
tar xvf download

wget https://www.openssl.org/source/openssl-1.0.2s.tar.gz
tar xvf openssl-1.0.2s.tar.gz

wget http://www.zlib.net/zlib-1.2.11.tar.gz
wget https://www.zlib.net/fossils/zlib-1.2.11.tar.gz
tar xvf zlib-1.2.11.tar.gz
```

ftp.pcre.org FTP site is no longer available.
### Build Tengine
```
./configure --add-module=./modules/mod_dubbo --add-module=./modules/ngx_multi_upstream_module --add-module=./modules/mod_config --with-pcre=./pcre-8.43/ --with-openssl=./openssl-1.0.2s/ --with-zlib=./zlib-1.2.11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,31 @@
<dubbo.version>3.1.6</dubbo.version>
</properties>

<dependencyManagement>
<dependencies>
<!-- Spring Boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>${dubbo.version}</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-bom</artifactId>
<version>${dubbo.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.apache.dubbo.sample</groupId>
Expand All @@ -53,10 +78,15 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>

<!-- Spring Boot dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/
package org.apache.dubbo.samples.tengine.provider;

import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.samples.tengine.DemoService;

import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
Expand All @@ -39,6 +39,7 @@
import java.util.List;
import java.util.Map;

@DubboService(registry="multicast")
public class DemoServiceImpl implements DemoService {
@Override
public Map<String, Object> tengineDubbo(Map<String, Object> context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@
*/
package org.apache.dubbo.samples.tengine.provider;

import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.concurrent.CountDownLatch;

@EnableDubbo
@SpringBootApplication
public class Provider {

/**
Expand All @@ -28,9 +33,7 @@ public class Provider {
* before running your application.
*/
public static void main(String[] args) throws Exception {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"META-INF/spring/dubbo-demo-provider.xml"});
context.start();

SpringApplication.run(Provider.class,args);
System.out.println("dubbo service started");
new CountDownLatch(1).await();
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

dubbo:
application:
name: tengine-provider
protocol:
name: dubbo
port: 20880
threads: 1024
registry:
id : multicast
address: multicast://224.5.6.7:1234
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ ADD https://github.com/alibaba/tengine/archive/${TENGINE_VERSION}.tar.gz tengine

RUN tar xvf tengine.tar.gz \
&& cd ./tengine-${TENGINE_VERSION} \
&& wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz \
&& wget -O pcre-8.43.tar.gz https://sourceforge.net/projects/pcre/files/pcre/8.43/pcre-8.43.tar.gz/download \
&& tar xvf pcre-8.43.tar.gz \
&& wget https://www.openssl.org/source/openssl-1.0.2s.tar.gz \
&& tar xvf openssl-1.0.2s.tar.gz \
&& wget http://www.zlib.net/zlib-1.2.11.tar.gz \
&& wget https://www.zlib.net/fossils/zlib-1.2.11.tar.gz \
&& tar xvf zlib-1.2.11.tar.gz \
&& ./configure --add-module=./modules/mod_dubbo --add-module=./modules/ngx_multi_upstream_module --add-module=./modules/mod_config --with-pcre=./pcre-8.43/ --with-openssl=./openssl-1.0.2s/ --with-zlib=./zlib-1.2.11 \
&& make \
Expand Down
35 changes: 0 additions & 35 deletions 2-advanced/dubbo-samples-tengine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,41 +34,6 @@
<module>dubbo-samples-tengine-provider</module>
</modules>

<dependencyManagement>
<dependencies>
<!-- Spring Boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>${dubbo.version}</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-bom</artifactId>
<version>${dubbo.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Spring Boot dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
Expand Down