Skip to content

Commit

Permalink
Merge pull request #11493 from ecostanzi/fix-infinispan-build
Browse files Browse the repository at this point in the history
fix infinispan service discovery configuration
  • Loading branch information
pascalgrimaud authored Mar 22, 2020
2 parents 594fc34 + 9b6728d commit b9240e6
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 6 deletions.
3 changes: 3 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ jobs:
ms-micro-eureka-jwt:
JHI_APP: ms-micro-eureka-jwt
JHI_ENTITY: micro
ms-micro-eureka-infinispan:
JHI_APP: ms-micro-eureka-infinispan
JHI_ENTITY: micro
ms-react-gateway-consul-jwt:
JHI_APP: ms-react-gateway-consul-jwt
JHI_ENTITY: sqllight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ import org.jgroups.protocols.pbcast.STABLE;
import org.jgroups.stack.IpAddress;
import org.jgroups.stack.ProtocolStack;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import org.springframework.beans.factory.BeanInitializationException;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -586,13 +587,12 @@ public class CacheConfiguration {
* from registry and sends only unicast messages to the host list.
*/
private JChannel getTransportChannel() {
JChannel channel = null;
List<PhysicalAddress> initialHosts = new ArrayList<>();
JChannel channel;
List<InetSocketAddress> initialHosts = new ArrayList<>();
try {
for (ServiceInstance instance : discoveryClient.getInstances(registration.getServiceId())) {
String clusterMember = instance.getHost() + ":7800";
log.debug("Adding Infinispan cluster member {}", clusterMember);
initialHosts.add(new IpAddress(clusterMember));
log.debug("Adding Infinispan cluster member {}:{}", instance.getHost(), 7800);
initialHosts.add(new InetSocketAddress(instance.getHost(), 7800));
}
TCP tcp = new TCP();
tcp.setBindAddress(InetAddress.getLocalHost());
Expand All @@ -602,7 +602,7 @@ public class CacheConfiguration {
tcp.setThreadPoolKeepAliveTime(60000);

TCPPING tcpping = new TCPPING();
initialHosts.add(new IpAddress(InetAddress.getLocalHost(), 7800));
initialHosts.add(new InetSocketAddress(InetAddress.getLocalHost(), 7800));
tcpping.setInitialHosts(initialHosts);
tcpping.setErgonomics(false);
tcpping.setPortRange(10);
Expand Down
1 change: 1 addition & 0 deletions test-integration/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Those are described in `.yo-rc.json` files which is the descriptor file created
- jdl-default
- ms-micro-consul
- ms-micro-eureka
- ms-micro-eureka-infinispan
- ms-micro-eureka-jwt
- ms-ngx-gateway-consul
- ms-ngx-gateway-eureka
Expand Down
34 changes: 34 additions & 0 deletions test-integration/samples/ms-micro-eureka-infinispan/.yo-rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"generator-jhipster": {
"applicationType": "microservice",
"baseName": "samplesMicroserviceEurekaInfinispan",
"packageName": "io.github.jhipster.sample",
"packageFolder": "io/github/jhipster/sample",
"authenticationType": "jwt",
"cacheProvider": "infinispan",
"enableHibernateCache": true,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "mysql",
"searchEngine": false,
"serviceDiscoveryType": "eureka",
"buildTool": "maven",
"enableTranslation": true,
"nativeLanguage": "en",
"languages": ["en", "fr"],
"testFrameworks": ["gatling"],
"skipClient": true,
"skipUserManagement": true,
"serverPort": "8081",
"jhiPrefix": "jhi",
"websocket": false,
"messageBroker": false,
"clientPackageManager": "npm",
"jwtSecretKey": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
"embeddableLaunchScript": false,
"entitySuffix": "",
"dtoSuffix": "DTO",
"otherModules": [],
"blueprints": []
}
}

0 comments on commit b9240e6

Please sign in to comment.