Commit 356331e4 by amira

service-pubsub 1.0.2

- serviceUrl can be with multiple hosts: e.g. "pulsar://localhost:6650,localhost:6650"
## 2.3.2
- update common-utils to 1.3.4
- update common to 1.0.3 , clients to 1.0.1
parent 706a3f14
### Microservice Framework in JAVA ### Microservice Framework in JAVA
## service-pubsub 1.0.2
- serviceUrl can be with multiple hosts: e.g. "pulsar://localhost:6650,localhost:6650"
## 2.3.2
- update common-utils to 1.3.4
- update common to 1.0.3 , clients to 1.0.1
## 2.3.1 ## 2.3.1
- add retention policy and ttl for pulsar, move PulsarParams from common - add retention policy and ttl for pulsar, move PulsarParams from common
## 2.3.0 ## 2.3.0
......
...@@ -3,7 +3,7 @@ plugins { ...@@ -3,7 +3,7 @@ plugins {
} }
group 'com.ipgallery.common' group 'com.ipgallery.common'
version '2.3.1' version '2.3.2'
apply plugin: 'java' apply plugin: 'java'
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
...@@ -64,14 +64,14 @@ dependencies { ...@@ -64,14 +64,14 @@ dependencies {
commonCompile ( commonCompile (
'com.fasterxml.jackson.core:jackson-databind:2.2.3', 'com.fasterxml.jackson.core:jackson-databind:2.2.3',
'io.jsonwebtoken:jjwt:0.6.0', 'io.jsonwebtoken:jjwt:0.6.0',
'com.ipgallery.common:utils:1.2.5', 'com.ipgallery.common:utils:1.3.4',
'com.github.stephenc.eaio-uuid:uuid:3.4.0', 'com.github.stephenc.eaio-uuid:uuid:3.4.0',
'com.netflix.hystrix:hystrix-core:1.4.14' 'com.netflix.hystrix:hystrix-core:1.4.14'
) )
clientsCompile ( clientsCompile (
files('build/common/microservice-common.jar'), files('build/common/microservice-common.jar'),
'com.ipgallery.common:utils:1.2.5', 'com.ipgallery.common:utils:1.3.4',
'com.netflix.rxjava:rxjava-apache-http:0.20.7', 'com.netflix.rxjava:rxjava-apache-http:0.20.7',
'com.netflix.hystrix:hystrix-metrics-event-stream:1.4.12', 'com.netflix.hystrix:hystrix-metrics-event-stream:1.4.12',
'com.squareup.okhttp3:okhttp:3.8.0' 'com.squareup.okhttp3:okhttp:3.8.0'
...@@ -93,7 +93,7 @@ dependencies { ...@@ -93,7 +93,7 @@ dependencies {
'io.dropwizard.metrics:metrics-core:3.1.0', 'io.dropwizard.metrics:metrics-core:3.1.0',
'redis.clients:jedis:2.4.2', 'redis.clients:jedis:2.4.2',
'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.0.2', 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.0.2',
'com.ipgallery.common:utils:1.2.5', 'com.ipgallery.common:utils:1.3.4',
'com.ipgallery.common:rabbitmq:1.0.3', 'com.ipgallery.common:rabbitmq:1.0.3',
'com.ecwid.consul:consul-api:1.1.9', 'com.ecwid.consul:consul-api:1.1.9',
'com.github.davidb:metrics-influxdb:0.8.2', 'com.github.davidb:metrics-influxdb:0.8.2',
...@@ -119,7 +119,7 @@ dependencies { ...@@ -119,7 +119,7 @@ dependencies {
task commonJar(type: Jar) { task commonJar(type: Jar) {
from configurations.commonCompile.collect { zipTree it } from configurations.commonCompile.collect { zipTree it }
from sourceSets.common.output from sourceSets.common.output
version = '1.0.2' version = '1.0.3'
archiveName = "microservice-common.jar" archiveName = "microservice-common.jar"
destinationDir = file("build/common") destinationDir = file("build/common")
} }
...@@ -130,7 +130,7 @@ task servicePubsubJar(type: Jar) { ...@@ -130,7 +130,7 @@ task servicePubsubJar(type: Jar) {
mustRunAfter commonJar mustRunAfter commonJar
//from configurations.servicePubsubCompile.collect { zipTree it } //from configurations.servicePubsubCompile.collect { zipTree it }
from sourceSets.servicePubsub.output from sourceSets.servicePubsub.output
version = '1.0.1' version = '1.0.2'
archiveName = "microservice-service-pubsub.jar" archiveName = "microservice-service-pubsub.jar"
destinationDir = file("build/servicePubsub") destinationDir = file("build/servicePubsub")
} }
...@@ -141,7 +141,7 @@ task clientsJar(type: Jar) { ...@@ -141,7 +141,7 @@ task clientsJar(type: Jar) {
mustRunAfter commonJar mustRunAfter commonJar
//from configurations.clientsCompile.collect { zipTree it } //from configurations.clientsCompile.collect { zipTree it }
from sourceSets.clients.output from sourceSets.clients.output
version = '1.0.0' version = '1.0.1'
archiveName = "microservice-clients.jar" archiveName = "microservice-clients.jar"
destinationDir = file("build/clients") destinationDir = file("build/clients")
} }
......
...@@ -38,14 +38,15 @@ public class PulsarParams { ...@@ -38,14 +38,15 @@ public class PulsarParams {
} }
public PulsarParamsBuilder setServiceUrl(String serviceUrl) { public PulsarParamsBuilder setServiceUrl(String serviceUrl) {
final String[] parts = serviceUrl.split(":"); // final String[] parts = serviceUrl.split(":");
if(parts.length < 2 ) { // || !StringUtils.isNumeric(parts[1])) // if(parts.length < 2 ) { // || !StringUtils.isNumeric(parts[1]))
this.serviceUrl = String.format("%s:%u",serviceUrl, DEFAULT_SERVICE_PORT); // this.serviceUrl = String.format("%s:%u",serviceUrl, DEFAULT_SERVICE_PORT);
} else if (!StringUtils.isNumeric(parts[1])){ // } else if (!StringUtils.isNumeric(parts[1])){
this.serviceUrl = String.format("%s:%u",parts[0], DEFAULT_SERVICE_PORT); // this.serviceUrl = String.format("%s:%u",parts[0], DEFAULT_SERVICE_PORT);
} else { // } else {
this.serviceUrl = serviceUrl; // this.serviceUrl = serviceUrl;
} // }
this.serviceUrl = serviceUrl;
return this; return this;
} }
......
...@@ -103,11 +103,11 @@ public class TestMicroserviceApp { ...@@ -103,11 +103,11 @@ public class TestMicroserviceApp {
.setServerParams(new ZMQParams.ServerParams(ZMQParams.ServerParams.EnumProtocol.eTcp,32020,"localhost")) .setServerParams(new ZMQParams.ServerParams(ZMQParams.ServerParams.EnumProtocol.eTcp,32020,"localhost"))
.build(); .build();
CommonServices.IService pulsarPubSub = ServiceBuilderFactory.createPubSubServicePulsarBuilder(CommonServices.EnumPubSubServiceMode.E_BOTH) CommonServices.IService pulsarPubSub = ServiceBuilderFactory.createPubSubServicePulsarBuilder(CommonServices.EnumPubSubServiceMode.E_BOTH)
.setServiceUrl("localhost:6650") .setServiceUrl("pulsar://localhost:6650,localhost:6650")
.setMsgTtl(60) .setMsgTtl(60)
.setRetentionSizeMB(20) .setRetentionSizeMB(20)
.setRetentionTimeMin(60) .setRetentionTimeMin(60)
.setAdminUrl(null) .setAdminUrl("localhost:8080")
.setClusters("standalone") .setClusters("standalone")
.build(); .build();
......
...@@ -29,7 +29,7 @@ public class TestPulsar { ...@@ -29,7 +29,7 @@ public class TestPulsar {
@Test @Test
public void testTopicProducer() throws PulsarClientException { public void testTopicProducer() throws PulsarClientException {
String localClusterUrl = "pulsar://localhost:6650"; String localClusterUrl = "pulsar://localhost:6650";
String namespace = "mcx/testApp"; // This namespace is created automatically String namespace = "mcx/activities"; // This namespace is created automatically
String topic = String.format("persistent://%s/activity", namespace); String topic = String.format("persistent://%s/activity", namespace);
PulsarClient client = PulsarClient.builder() PulsarClient client = PulsarClient.builder()
.serviceUrl(localClusterUrl) .serviceUrl(localClusterUrl)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment