Skip to content

Commit

Permalink
feat: add maven profiles for Infinispan 14
Browse files Browse the repository at this point in the history
  • Loading branch information
pk-work committed Aug 11, 2023
1 parent 5ea738f commit 58cfa51
Show file tree
Hide file tree
Showing 10 changed files with 167 additions and 6 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci-4.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,42 @@ jobs:
with:
name: heap-dump
path: target/*.hprof
Test-ISPN14:
name: Run tests
strategy:
matrix:
os: [ ubuntu-latest ]
jdk: [ 11 ]
profile: [ISPN-14]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install JDK
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.jdk }}
distribution: temurin
- name: Run tests
run: mvn -P ${{ matrix.profile }} -s .github/maven-ci-settings.xml -B -DtestLogLevel=OFF test
Test-ISPN14-jakarta:
name: Run tests
strategy:
matrix:
os: [ ubuntu-latest ]
jdk: [ 11 ]
profile: [ ISPN-14-jakarta ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install JDK
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.jdk }}
distribution: temurin
- name: Run tests
run: mvn -P ${{ matrix.profile }} -s .github/maven-ci-settings.xml -B -DtestLogLevel=OFF test
Deploy:
name: Deploy to OSSRH
if: ${{ github.repository_owner == 'vert-x3' && (github.event_name == 'push' || github.event_name == 'schedule') }}
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<doc.skip>true</doc.skip>
<rxjava3.version>3.0.13</rxjava3.version>
<infinispan.version>13.0.17.Final</infinispan.version>
<infinispan.jakartasuffix></infinispan.jakartasuffix>
</properties>

<dependencyManagement>
Expand Down
17 changes: 15 additions & 2 deletions vertx-infinispan/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
<artifactId>infinispan-core${infinispan.jakartasuffix}</artifactId>
<version>${infinispan.version}</version>
<exclusions>
<exclusion>
Expand All @@ -67,7 +67,7 @@
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-multimap</artifactId>
<artifactId>infinispan-multimap${infinispan.jakartasuffix}</artifactId>
<version>${infinispan.version}</version>
</dependency>
<!-- Same version as Camel 3 -->
Expand Down Expand Up @@ -271,6 +271,19 @@
</build>

<profiles>
<profile>
<id>ISPN-14</id>
<properties>
<infinispan.version>14.0.13.Final</infinispan.version>
</properties>
</profile>
<profile>
<id>ISPN-14-jakarta</id>
<properties>
<infinispan.version>14.0.13.Final</infinispan.version>
<infinispan.jakartasuffix>-jakarta</infinispan.jakartasuffix>
</properties>
</profile>
<profile>
<id>coverage</id>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.infinispan.commons.api.CacheContainerAdmin;
import org.infinispan.commons.util.FileLookup;
import org.infinispan.commons.util.FileLookupFactory;
import org.infinispan.commons.util.Version;
import org.infinispan.configuration.parsing.ConfigurationBuilderHolder;
import org.infinispan.configuration.parsing.ParserRegistry;
import org.infinispan.context.Flag;
Expand Down Expand Up @@ -72,11 +73,12 @@ public class InfinispanClusterManager implements ClusterManager {

private static final Logger log = LoggerFactory.getLogger(InfinispanClusterManager.class);

private static final boolean isISPN13 = "13".equals(Version.getMajor());
private static final String VERTX_INFINISPAN_CONFIG_PROP_NAME = "vertx.infinispan.config";
private static final String INFINISPAN_XML = "infinispan.xml";
private static final String DEFAULT_INFINISPAN_XML = "default-infinispan.xml";
private static final String DEFAULT_INFINISPAN_XML = isISPN13 ? "default-infinispan-13.xml" : "default-infinispan-14.xml";
private static final String VERTX_JGROUPS_CONFIG_PROP_NAME = "vertx.jgroups.config";
private static final String JGROUPS_XML = "jgroups.xml";
private static final String JGROUPS_XML = isISPN13 ? "jgroups-4.xml" : "jgroups-5.xml";

private final String ispnConfigPath;
private final String jgroupsConfigPath;
Expand Down Expand Up @@ -119,6 +121,7 @@ public InfinispanClusterManager(DefaultCacheManager cacheManager) {

@Override
public void init(Vertx vertx, NodeSelector nodeSelector) {
log.info("Cluster Manager is using Infinispan " + Version.getVersion());
this.vertx = (VertxInternal) vertx;
this.nodeSelector = nodeSelector;
}
Expand Down
35 changes: 35 additions & 0 deletions vertx-infinispan/src/main/resources/default-infinispan-14.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2022 Red Hat, Inc.
~
~ Red Hat 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.
-->

<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:14.0 http://www.infinispan.org/schemas/infinispan-config-14.0.xsd"
xmlns="urn:infinispan:config:14.0">

<jgroups>
<stack-file name="jgroups" path="tcp.xml"/>
</jgroups>

<cache-container default-cache="distributed-cache">
<transport stack="jgroups"/>
<distributed-cache name="distributed-cache"/>
<replicated-cache name="__vertx.subs"/>
<replicated-cache name="__vertx.haInfo"/>
<replicated-cache name="__vertx.nodeInfo"/>
<distributed-cache-configuration name="__vertx.distributed.cache.configuration"/>
</cache-container>

</infinispan>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.vertx.core.*;
import io.vertx.core.spi.cluster.ClusterManager;
import io.vertx.ext.cluster.infinispan.InfinispanClusterManager;
import org.infinispan.commons.util.Version;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;

Expand Down Expand Up @@ -68,11 +69,12 @@ protected ClusterManager getClusterManager() {

@Override
protected List<String> getExternalNodeSystemProperties() {
String jgroupsVersion = Version.getMajor().equals(13) ? "4" : "5";
return Arrays.asList(
"-Djava.net.preferIPv4Stack=true",
"-Djgroups.join_timeout=1000",
"-Dvertx.infinispan.config=infinispan.xml",
"-Dvertx.jgroups.config=jgroups.xml",
"-Dvertx.jgroups.config=jgroups-"+ jgroupsVersion + ".xml",
"-Djgroups.file.location=" + System.getProperty("jgroups.file.location"),
"-Dvertx.logger-delegate-factory-class-name=io.vertx.core.logging.SLF4JLogDelegateFactory"
);
Expand Down
71 changes: 71 additions & 0 deletions vertx-infinispan/src/test/resources/jgroups-5.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<!--
~ Copyright 2022 Red Hat, Inc.
~
~ Red Hat 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.
-->

<config xmlns="urn:org:jgroups"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups-5.2.xsd">
<!-- jgroups.tcp.address is deprecated and will be removed, see ISPN-11867 -->
<TCP bind_addr="${jgroups.bind.address,jgroups.tcp.address:SITE_LOCAL}"
bind_port="${jgroups.bind.port,jgroups.tcp.port:7800}"
thread_naming_pattern="pl"
send_buf_size="640k"
sock_conn_timeout="300"
bundler_type="transfer-queue"

thread_pool.min_threads="${jgroups.thread_pool.min_threads:0}"
thread_pool.max_threads="${jgroups.thread_pool.max_threads:200}"
thread_pool.keep_alive_time="60000"
/>
<FILE_PING location="${jgroups.file.location}"
register_shutdown_hook="false"
/>
<MERGE3 min_interval="10000"
max_interval="30000"
/>
<FD_SOCK/>
<!-- Suspect node `timeout` to `timeout + timeout_check_interval` millis after the last heartbeat -->
<FD_ALL timeout="10000"
interval="2000"
timeout_check_interval="1000"
/>
<VERIFY_SUSPECT timeout="1000"/>
<pbcast.NAKACK2 use_mcast_xmit="false"
xmit_interval="200"
xmit_table_num_rows="50"
xmit_table_msgs_per_row="1024"
xmit_table_max_compaction_time="30000"
resend_last_seqno="true"
/>
<UNICAST3 conn_close_timeout="5000"
xmit_interval="200"
xmit_table_num_rows="50"
xmit_table_msgs_per_row="1024"
xmit_table_max_compaction_time="30000"
/>
<pbcast.STABLE desired_avg_gossip="5000"
max_bytes="1M"
/>
<pbcast.GMS print_local_addr="false"
join_timeout="${jgroups.join_timeout:2000}"
/>
<UFC max_credits="4m"
min_threshold="0.40"
/>
<MFC max_credits="4m"
min_threshold="0.40"
/>
<FRAG3/>
</config>
2 changes: 1 addition & 1 deletion vertx-web-sstore-infinispan/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-client-hotrod</artifactId>
<artifactId>infinispan-client-hotrod${infinispan.jakartasuffix}</artifactId>
<version>${infinispan.version}</version>
<exclusions>
<exclusion>
Expand Down

0 comments on commit 58cfa51

Please sign in to comment.