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

update quickstart md files for gradle version #332

Merged
merged 7 commits into from
May 8, 2021
Merged
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
132 changes: 66 additions & 66 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ allprojects {
apply plugin: "java-library"
apply plugin: 'signing'

if (project.findProperty("jdk") == "1.7") {
sourceCompatibility = 1.7
targetCompatibility = 1.7
version = version + "-jdk7"
} else {
sourceCompatibility = 1.8
targetCompatibility = 1.8
version = version + "-jdk8"
}

// print(project)
// if (project.findProperty("jdk") == "1.7") {
// sourceCompatibility = 1.7
// targetCompatibility = 1.7
// version = version + "-jdk7"
// } else {
// sourceCompatibility = 1.8
// targetCompatibility = 1.8
// version = version + "-jdk8"
// }
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'

compileJava.options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
Expand Down Expand Up @@ -324,7 +324,7 @@ subprojects {
}
copy {
into '../dist/lib'
from project.configurations.runtime
from project.configurations.runtimeClasspath
exclude '**/*.properties*'
exclude '**/*testng*.jar'
exclude '**/*powermock*.jar'
Expand Down Expand Up @@ -382,12 +382,6 @@ subprojects {
}
}

signing {
sign packageJavadoc, packageSources, jar
}



repositories {
maven { url "https://maven.aliyun.com/repository/public" }
mavenCentral()
Expand All @@ -400,56 +394,62 @@ subprojects {
resolutionStrategy.cacheDynamicVersionsFor 0, TimeUnit.SECONDS
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact packageSources
artifact packageJavadoc
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'EventMesh'
description = 'Apache EventMesh'
url = 'https://github.com/apache/incubator-eventmesh'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'Apache EventMesh(incubating)'
name = 'Apache EventMesh(incubating) of ASF'
url = 'https://eventmesh.apache.org/'
}
}
scm {
connection = 'scm:git:git@github.com:apache/incubator-eventmesh.git'
developerConnection = 'scm:git:git@github.com:apache/incubator-eventmesh.git'
url = 'https://github.com/apache/incubator-eventmesh'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = 'https://repository.apache.org/content/repositories/releases/'
def snapshotsRepoUrl = 'https://repository.apache.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username apacheUserName
password apachePassWord
}

// uploadArchives {
// repositories {
// mavenDeployer {
// beforeDeployment {
// MavenDeployment deployment -> signing.signPom(deployment)
// }
// // 指定上传的路径
// def releaseRepo = 'https://repository.apache.org/content/repositories/releases/'
// def snapshotsRepo = 'https://repository.apache.org/content/repositories/snapshots/'
// repository(url: releaseRepo) {
// authentication(userName: apacheUserName, password: apachePassWord)
// }
//
// snapshotRepository(url: snapshotsRepo) {
// authentication(userName: apacheUserName, password: apachePassWord)
// }
//
//
// pom.project {
// name 'Apache EventMesh'
// packaging 'jar'
// // optionally artifactId can be defined here
// description 'Apache EventMesh'
// url 'https://github.com/apache/incubator-eventmesh'
//
// scm {
// connection 'scm:git:git@github.com:apache/incubator-eventmesh.git'
// developerConnection 'scm:git:git@github.com:apache/incubator-eventmesh.git'
// url 'https://github.com/apache/incubator-eventmesh'
// }
//
// licenses {
// license {
// name 'The Apache License, Version 2.0'
// url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
// }
// }
//
// developers {
// developer {
// id 'Apache EventMesh(incubating)'
// name 'Apache EventMesh(incubating) of ASF'
// url 'https://eventmesh.apache.org/'
// }
// }
// }
// }
// }
// }
}
}
}

signing {
sign publishing.publications.mavenJava
}

}

4 changes: 2 additions & 2 deletions docs/cn/instructions/eventmesh-runtime-quickstart.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```
建议使用64位操作系统,建议使用Linux / Unix;
64位JDK 1.8+;
Gradle至少为5.6, 推荐 5.6.*
Gradle至少为7.0, 推荐 7.0.*
```

### 1.2 下载源码
Expand All @@ -19,7 +19,7 @@ Gradle至少为5.6, 推荐 5.6.*

```$ xslt
unzip EventMesh-master.zip
cd / *您的部署路径* /EventMesh-master/eventmesh-runtime
cd / *您的部署路径* /EventMesh-master
gradle clean dist tar -x test
```

Expand Down
6 changes: 3 additions & 3 deletions docs/en/instructions/eventmesh-runtime-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```
64bit OS, Linux/Unix is recommended;
64bit JDK 1.8+;
Gradle at least 5.6, eg 5.6.*
Gradle at least 7.0, eg 7.0.*
```

### 1.2 download sources
Expand All @@ -19,8 +19,8 @@ You will get **EventMesh-master.zip**

```$xslt
unzip EventMesh-master.zip
cd /*YOUR DEPLOY PATH*/EventMesh-master/eventmesh-runtime
gradle clean tar -x test
cd /*YOUR DEPLOY PATH*/EventMesh-master
gradle clean dist tar -x test
```

You will get **EventMesh_1.2.0.tar.gz** in directory /* YOUR DEPLOY PATH */EventMesh-master/build
Expand Down
2 changes: 1 addition & 1 deletion docs/en/instructions/eventmesh-store-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You will get **DefiBus-master.zip**

### build sources

The eventmesh-store takes DeFiBus for example at the follwing parts, because eventmesh depends on defibus as store layer
The eventmesh-store takes DeFiBus for example at the following parts, because eventmesh depends on defibus as store layer
by default, other implements such as Rocketmq etc. is coming soon.

```
Expand Down
2 changes: 1 addition & 1 deletion eventmesh-connector-rocketmq/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

group=org.apache.eventmesh
version=1.2.0
version=1.2.0-SNAPSHOT
rocketmq_version=4.7.1
mavenUserName=
mavenPassword=
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

public abstract class AbrstractHTTPServer extends AbstractRemotingServer {

public Logger logger = LoggerFactory.getLogger(this.getClass());
public Logger httpServerLogger = LoggerFactory.getLogger(this.getClass());

public Logger httpLogger = LoggerFactory.getLogger("http");

Expand Down Expand Up @@ -158,15 +158,15 @@ public void start() throws Exception {
.channel(NioServerSocketChannel.class)
.childHandler(new HttpsServerInitializer(SSLContextFactory.getSslContext())).childOption(ChannelOption.SO_KEEPALIVE, Boolean.TRUE);
try {
logger.info("HTTPServer[port={}] started......", this.port);
httpServerLogger.info("HTTPServer[port={}] started......", this.port);
ChannelFuture future = b.bind(this.port).sync();
future.channel().closeFuture().sync();
} catch (Exception e) {
logger.error("HTTPServer start Err!", e);
httpServerLogger.error("HTTPServer start Err!", e);
try {
shutdown();
} catch (Exception e1) {
logger.error("HTTPServer shutdown Err!", e);
httpServerLogger.error("HTTPServer shutdown Err!", e);
}
return;
}
Expand Down Expand Up @@ -290,7 +290,7 @@ protected void channelRead0(ChannelHandlerContext ctx, HttpRequest httpRequest)
AsyncContext<HttpCommand> asyncContext = new AsyncContext<HttpCommand>(requestCommand, responseCommand, asyncContextCompleteHandler);
processEventMeshRequest(ctx, asyncContext);
} catch (Exception ex) {
logger.error("AbrstractHTTPServer.HTTPHandler.channelRead0 err", ex);
httpServerLogger.error("AbrstractHTTPServer.HTTPHandler.channelRead0 err", ex);
} finally {
try {
decoder.destroy();
Expand Down Expand Up @@ -330,7 +330,7 @@ public void processEventMeshRequest(final ChannelHandlerContext ctx,

sendResponse(ctx, asyncContext.getResponse().httpResponse());
} catch (Exception e) {
logger.error("process error", e);
httpServerLogger.error("process error", e);
}
});
} catch (RejectedExecutionException re) {
Expand Down Expand Up @@ -376,7 +376,7 @@ public void channelActive(ChannelHandlerContext ctx) throws Exception {
final String remoteAddress = RemotingHelper.parseChannelRemoteAddr(ctx.channel());
int c = connections.incrementAndGet();
if (c > 20000) {
logger.warn("client|http|channelActive|remoteAddress={}|msg={}", remoteAddress, "too many client(20000) connect " +
httpServerLogger.warn("client|http|channelActive|remoteAddress={}|msg={}", remoteAddress, "too many client(20000) connect " +
"this eventMesh server");
ctx.close();
return;
Expand All @@ -399,7 +399,7 @@ public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exc
IdleStateEvent event = (IdleStateEvent) evt;
if (event.state().equals(IdleState.ALL_IDLE)) {
final String remoteAddress = RemotingHelper.parseChannelRemoteAddr(ctx.channel());
logger.info("client|http|userEventTriggered|remoteAddress={}|msg={}", remoteAddress, evt.getClass()
httpServerLogger.info("client|http|userEventTriggered|remoteAddress={}|msg={}", remoteAddress, evt.getClass()
.getName());
ctx.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,37 +239,4 @@ public void onResponse(HttpCommand httpCommand) {
public boolean rejectRequest() {
return false;
}

/**
* notify ConsumerManager 组级别
*/
private void notifyConsumerManager(String consumerGroup, ConsumerGroupConf latestConsumerGroupConfig,
ConcurrentHashMap<String, ConsumerGroupConf> localConsumerGroupMapping) throws Exception {
ConsumerGroupManager cgm = eventMeshHTTPServer.getConsumerManager().getConsumer(consumerGroup);
if (cgm == null) {
ConsumerGroupStateEvent notification = new ConsumerGroupStateEvent();
notification.action = ConsumerGroupStateEvent.ConsumerGroupStateAction.NEW;
notification.consumerGroup = consumerGroup;
notification.consumerGroupConfig = latestConsumerGroupConfig;
eventMeshHTTPServer.getEventBus().post(notification);
return;
}

if (!latestConsumerGroupConfig.equals(cgm.getConsumerGroupConfig())) {
ConsumerGroupStateEvent notification = new ConsumerGroupStateEvent();
notification.action = ConsumerGroupStateEvent.ConsumerGroupStateAction.CHANGE;
notification.consumerGroup = consumerGroup;
notification.consumerGroupConfig = latestConsumerGroupConfig;
eventMeshHTTPServer.getEventBus().post(notification);
return;
}

if (latestConsumerGroupConfig == null) {
ConsumerGroupStateEvent notification = new ConsumerGroupStateEvent();
notification.action = ConsumerGroupStateEvent.ConsumerGroupStateAction.DELETE;
notification.consumerGroup = consumerGroup;
eventMeshHTTPServer.getEventBus().post(notification);
}
return;
}
}
Loading