WildFly integration with ActiveMQ using JCA resource adapter - jms

I am trying to integrate ActiveMQ 5.15.13 with WildFly 21.0.1.Final using the ActiveMQ JCA resource adapter. However, I am getting errors while doing it. I was able to integrate WildFly 9 with ActiveMQ 5.10.
I'm getting the following errors:
2021-01-22 19:20:18,577 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 93) MSC000001: Failed to start service jboss.ra.deployer."activemq-rar-5.15.13.rar": org.jboss.msc.service.StartException in service jboss.ra.deployer."activemq-rar-5.15.13.rar": WFLYJCA0046: Failed to start RA deployment [activemq-rar-5.15.13.rar]
at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterDeploymentService$1.run(ResourceAdapterDeploymentService.java:176)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1348)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:513)
Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/opt/apps/MerckContivoPilot/wildfly-21.0.1.Final/standalone/deployments/activemq-rar-5.15.13.rar/
at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:2058)
at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterDeploymentService$WildFLyRaDeployer.doDeploy(ResourceAdapterDeploymentService.java:233)
at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterDeploymentService.start(ResourceAdapterDeploymentService.java:126)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.jboss.jca.validator.ValidatorException: Severity: WARNING
Section: 20.7
Description: Invalid config-property-type for AdminObject.
Code: Class: org.apache.activemq.pool.XaPooledConnectionFactory Property: tmFromJndi Type: boolean
Severity: ERROR
Section: 13.4.2.2
Description: An ActivationSpec class must implement the ActivationSpec interface
Code: org.apache.activemq.ra.ActiveMQActivationSpec
Severity: ERROR
Section: 5.3.1
Description: A ResourceAdapter must implement the javax.resource.spi.ResourceAdapter interface.
Code: org.apache.activemq.ra.ActiveMQResourceAdapter
Severity: ERROR
Section: 6.5.3.2
Description: The class must implement the javax.resource.spi.ManagedConnectionFactory interface.
Code: org.apache.activemq.ra.ActiveMQManagedConnectionFactory
Resource Adapter configuration
<subsystem xmlns="urn:jboss:domain:resource-adapters:6.0">
<resource-adapters>
<resource-adapter id="activemq-ra">
<archive>activemq-rar-5.15.13.rar</archive>
<transaction-support>XATransaction</transaction-support>
<config-property name="ServerUrl">tcp://localhost:61616?soTimeout=20000&connectionTimeout=10000</config-property>
<config-property name="UserName">defaultUser</config-property>
<config-property name="UseInboundSession">false</config-property>
<config-property name="Password">defaultPassword</config-property>
<connection-definitions>
<connection-definition class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory" jndi-name="java:/ActiveMQ/QueueConnectionFactory" enabled="true" use-java-context="true" pool-name="ActiveMQ/QueueConnectionFactory" use-ccm="true">
<xa-pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>200</max-pool-size>
</xa-pool>
<timeout>
<blocking-timeout-millis>30000</blocking-timeout-millis>
<idle-timeout-minutes>5</idle-timeout-minutes>
</timeout>
</connection-definition>
</connection-definitions>
<admin-objects>
<admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:/queue/XMLPublishQueue" enabled="true" use-java-context="true" pool-name="XMLPublishQueue">
<config-property name="PhysicalName">XMLPublishQueue</config-property>
</admin-object>
<admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:/queue/SupportTasksQueue" enabled="true" use-java-context="true" pool-name="SupportTasksQueue">
<config-property name="PhysicalName">SupportTasksQueue</config-property>
</admin-object>
</admin-objects>
</resource-adapter>
</resource-adapters>
</subsystem>
Downloaded rar from
https://mvnrepository.com/artifact/org.apache.activemq/activemq-rar/5.15.13
Tried both ways (updating rar and without updating it) by following the below guides
https://access.redhat.com/solutions/1124023
http://www.mastertheboss.com/jboss-server/jboss-jms/integrate-activemq-with-wildfly
Update: Issue started when I added third-party jars through global-modules section under ee subsystem. I was adding java ee api jar
Any help/suggestions would be appreciated.

I deployed the ActiveMQ 5.13.13 JCA resource adapter to Wildfly 21.0.1.Final and I didn't see the same logging you saw. Everything appears to be working just fine. Here's what I did:
Download & unzip WildFly 21.0.1.Final.
Download the ActiveMQ 5.15.13 JCA RA and copy it to standalone/deployments.
Added this to standalone/configuration/standalone-full.xml:
<subsystem xmlns="urn:jboss:domain:resource-adapters:6.0">
<resource-adapters>
<resource-adapter id="activemq-ra-5">
<archive>activemq-rar-5.15.13.rar</archive>
<transaction-support>XATransaction</transaction-support>
<config-property name="ServerUrl">tcp://localhost:61616?soTimeout=20000&connectionTimeout=10000</config-property>
<config-property name="UserName">defaultUser</config-property>
<config-property name="UseInboundSession">false</config-property>
<config-property name="Password">defaultPassword</config-property>
<connection-definitions>
<connection-definition class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory" jndi-name="java:/ActiveMQ/QueueConnectionFactory" enabled="true" use-java-context="true" pool-name="ActiveMQ/QueueConnectionFactory" use-ccm="true">
<xa-pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>200</max-pool-size>
</xa-pool>
<timeout>
<blocking-timeout-millis>30000</blocking-timeout-millis>
<idle-timeout-minutes>5</idle-timeout-minutes>
</timeout>
</connection-definition>
</connection-definitions>
<admin-objects>
<admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:/queue/XMLPublishQueue" enabled="true" use-java-context="true" pool-name="XMLPublishQueue">
<config-property name="PhysicalName">XMLPublishQueue</config-property>
</admin-object>
<admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:/queue/SupportTasksQueue" enabled="true" use-java-context="true" pool-name="SupportTasksQueue">
<config-property name="PhysicalName">SupportTasksQueue</config-property>
</admin-object>
</admin-objects>
</resource-adapter>
</resource-adapters>
</subsystem>
Updated the jms-connection-factory attribute in the default-bindings element of the ee subsystem to use java:/ActiveMQ/QueueConnectionFactory:
<default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/ExampleDS" jms-connection-factory="java:/ActiveMQ/QueueConnectionFactory" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
Updated the resource-adapter-name attribute of the mdb/resource-adapter-ref element of the ejb3 subsystem to be ${ejb.resource-adapter-name:activemq-rar-5}:
<resource-adapter-ref resource-adapter-name="${ejb.resource-adapter-name:activemq-rar-5}"/>
Started WildFly using ./standalone.sh -c standalone-full.xml
Given that all this works normally I would say your problem is your global module, especially since it includes Java EE API classes. Application jars and library jars should not include Java/Jakarta EE API classes. The EE server (e.g. WildFly) provides all those. If you (or someone else) provides their own then that will cause classloading problems and that, in turn, will cause a lot of other weird problems. To reiterate, there's absolutely no reason for you to package Java/Jakarta EE API classes with your application or libraries deployed on the server.

Related

JDBC-backed Infinispan Cache on JBoss EAP/Wildfly

I am trying to create a JDBC-backed Infinispan cache on a JBoss EAP 7 (or Wildfly 10) server. My cache-container definition in standalone-full.xml looks like this:
<cache-container name="SearchCacheContainer" default-cache="SearchCache" module="org.infinispan.cachestore.jdbc">
<local-cache name="SearchCache">
<expiration max-idle="60000" interval="6000"/>
<transaction mode="FULL_XA"/>
<string-keyed-jdbc-store data-source="java:jboss/datasources/InfinispanCacheDS" preload="true" passivation="false" purge="false">
<property name="databaseType">
postgres
</property>
<property name="createTableOnStart">
true
</property>
<string-keyed-table prefix="str_">
<id-column name="id" type="VARCHAR2(200)"/>
<data-column name="datum" type="BLOB"/>
<timestamp-column name="version" type="NUMBER"/>
</string-keyed-table>
</string-keyed-jdbc-store>
</local-cache>
</cache-container>
I have also declared the necessary JDBC datasource in my server like this:
<datasource jndi-name="java:jboss/datasources/InfinispanCacheDS" pool-name="InfinispanCacheDS" enabled="true" use-java-context="true">
<connection-url>jdbc:postgresql://localhost:5432/db_infinispan_cache</connection-url>
<driver>postgresql-jdbc4</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>20</max-pool-size>
<prefill>true</prefill>
<flush-strategy>IdleConnections</flush-strategy>
</pool>
<security>
<user-name>infinispan_cache</user-name>
<password>mypasswordhere</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"/>
</validation>
<statement>
<track-statements>true</track-statements>
</statement>
</datasource>
However, when I attempt to start my JBoss server, I see the following error and the server fails to start:
14:02:09,692 ERROR [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0362: Capabilities required by resource '/subsystem=infinispan/cache-container=SearchCacheContainer/local-cache=SearchCache/store=string-jdbc' are not available:
org.wildfly.data-source.java:jboss/datasources/InfinispanCacheDS; There are no known registration points which can provide this capability.
Can anyone explain what it is that I am doing wrong here? The documentation on this particular feature seems pretty thin, so I'm sure there's something I'm missing, but can't figure out what. Thanks!
You need to refer the below links[1], [2]:
[1]http://infinispan.org/docs/5.3.x/user_guide/user_guide.html
[2]http://docs.jboss.org/hibernate/orm/4.2/devguide/en-US/html_single/#d5e1433

JBAS014775:New missing/unsatisfied dependencies:service jboss.jdbc-driver.ojdbc7_jar (missing) dependents: [service jboss.data-source.java:/JNDIName

I use netbeans 8.1. An I try to set up JBoss 7.1.1 on it. My database connection is oracle. But when I run my enterprise app, there is an error on my console like JBAS014775:New missing/unsatisfied dependencies.
standalone.xml
<datasource jta="false" jndi-name="java:/ETOBSORACLEJNDI" pool-name="oracle-thin_GTBDEV1_ETOBSPool" enabled="true" use-ccm="false">
<connection-url>jdbc:oracle:thin:#***************</connection-url>
<driver-class>oracle.jdbc.OracleDriver</driver-class>
<driver>ojdbc7.jar</driver>
<security>
<user-name>ETOBS</user-name>
<password>*******</password>
</security>
</datasource>
module.xml
<module xmlns="urn:jboss:module:1.1" name="com.oracle.ojdbc">
<resources>
<resource-root path="ojdbc7.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.servlet.api" optional="true"/>
any suggestion?
module.xml
<module xmlns="urn:jboss:module:1.1" name="com.oracle.jdbc">
<resources>
<resource-root path="ojdbc7.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
standalone(-).xml or domain(-).xml to configure a datasource that references this module:
<subsystem xmlns="urn:jboss:domain:datasources:1.2">
<datasources>
<datasource jndi-name="java:jboss/datasources/OracleDS" pool-name="OracleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:oracle:thin:#myhostname:1521:oracle</connection-url>
<driver>oracle</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>20</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>myuser</user-name>
<password>mypass</password>
</security>
<validation>
<validate-on-match>true</validate-on-match>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"></valid-connection-checker>
<stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"></stale-connection-checker>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"></exception-sorter>
</validation>
</datasource>
<drivers>
<driver name="oracle" module="com.oracle.jdbc">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
Follow the below step by step procedure:
Install a JDBC driver as a core module
Create a directory under $JBOSS_HOME/modules. In this example: "$JBOSS_HOME/modules/com/oracle/jdbc/main".
Put the the JDBC driver jar (ojdbc7.jar) in this directory
Create a module configuration file module.xml:
Note that the jdbc driver jar must contain a META-INF/services/java.sql.Driver text file that specifies the jdbc Driver, otherwise the Java service provider mechanism used to load the driver will not work. From the main/common vendors only Informix does not have this out of the box.
Configure a datasource setting in standalone.xml or domain.xml.
You can now edit your standalone(-).xml or domain(-).xml to configure a datasource that references this module:
jdbc:oracle:thin:#myhostname:1521:oracle
oracle
10
20
true
myuser
mypass
true
oracle.jdbc.xa.client.OracleXADataSource
Any JDBC 4 compliant driver will automatically be recognized and installed into the system by name and version by Java service provider mechanism. Such JDBC 4 compliant driver have a text file named META-INF/services/java.sql.Driver, which contains the name of the class(es) of the JDBC Drivers, in that JAR. However, non JDBC 4 compliant driver JAR does not contain such META-INF/services/java.sql.Driver file. So it needs some modification to be made deployable. Use ojdbc7.jar when using Java 1.7 .
Try this if you have any issue attach server.log file.

How to connect to a Kerberos-secured Apache Phoenix data source with WildFly?

I have recently spent several weeks trying to get WildFly to successfully connect to a Kerberized Apache Phoenix data source. There is a surprisingly limited amount of documentation on how to do this, but now that I have cracked it, I'm sharing.
Environment:
WildFly 9+. An equivalent JBoss version should also work (but untested). WildFly 8 does not contain the required org.jboss.security.negotiation.KerberosLoginModule class (but you can hack it, see Kerberos sql server datasource in Wildfly 8.2). I used WildFly 10.1.0.Final, and used a standalone deployment.
Apache Phoenix 4.2.0.2.2.4.10. I have not tested any other version.
Kerberos v5. My KDC is running on Windows Active Directory, but this should not make a noticable difference.
My Hadoop environment is a HortonWorks version, and maintained by Ambari. Ambari ensures that all of the configuration files and Kerberos implementation settings are correct.
Firstly, you'll want to add a system property to WildFly's standalone.xml to specify the location of the Kerberos configuration file:
...
</extensions>
<system-properties>
<property name="java.security.krb5.conf" value="/path/to/krb5.conf"/>
</system-properties>
...
I'm not going to go into the format of the krb5.conf file here, as it is dependent on your own implementation of Kerberos. What is important is that it contains the default realm and network location of the KDC. On Linux you can normally find it at /etc/krb5.conf or /etc/security/krb5.conf. If you're running WildFly on Windows, then make sure you use forward-slashes in your path, e.g. "C:/Source/krb5.conf"
Secondly, add two new security domains to standalone.xml - one called "Client" which is used by ZooKeeper, and another called "host", which is used by WildFly. Do not ask me why (it caused me so much pain) but the name of the "Client" security domain must match that defined in Zookeeper's JAAS client configuration file on the server. If you've set up with Ambari, "Client" is the default name. Also note that you cannot simply provide a jaas.config file as a system property, you must define it here:
<security-domain name="Client" cache-type="default">
<login-module code="com.sun.security.auth.module.Krb5LoginModule" flag="required">
<module-option name="useTicketCache" value="true"/>
<module-option name="debug" value="true"/>
</login-module>
</security-domain>
<security-domain name="host" cache-type="default">
<login-module code="org.jboss.security.negotiation.KerberosLoginModule" flag="required" module="org.jboss.security.negotiation">
<module-option name="useTicketCache" value="true"/>
<module-option name="debug" value="true"/>
<module-option name="refreshKrb5Config" value="true"/>
<module-option name="addGSSCredential" value="true"/>
</login-module>
</security-domain>
The module options will vary depending on your implementation. I'm getting my tickets from the default Java ticket cache, which is defined in the java.security file of your JRE, but you can supply a keytab here if you want. Note that setting storeKey to true broke my implementation. Check the Java documentation for all of the options. Note that each security domain uses a different login module: this is not by accident - Phoenix does not know how to use the org.jboss... version.
Now you need to provide WildFly with the org.apache.phoenix.jdbc.PhoenixDriver class in phoenix-<version>-client.jar. Create the following directory tree under the WildFly directory:
/modules/system/layers/base/org/apache/phoenix/main/
In the main directory, paste the phoenix--client.jar which you can find on the server (e.g. /usr/hdp/<version>/phoenix/client/bin) and create a module.xml file:
<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.1" name="org.apache.phoenix">
<resources>
<resource-root path="phoenix-<version>-client.jar">
<filter>
<exclude-set>
<path name="javax" />
<path name="org/xml" />
<path name="org/w3c/dom" />
<path name="org/w3c/sax" />
<path name="javax/xml/parsers" />
<path name="com/sun/org/apache/xerces/internal/jaxp" />
<path name="org/apache/xerces/jaxp" />
<path name="com/sun/jersey/core/impl/provider/xml" />
</exclude-set>
</filter>
</resource-root>
<resource-root path=".">
</resource-root>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="sun.jdk"/>
<module name="org.apache.log4j"/>
<module name="javax.transaction.api"/>
<module name="org.apache.commons.logging"/>
</dependencies>
</module>
You also need to paste the hbase-site.xml and core-site.xml from the server into the main directory. These are typically located in /usr/hdp/<version>/hbase/conf and /usr/hdp/<version>/hadoop/conf. If you don't add these, you will get a lot of unhelpful ZooKeeper getMaster errors! If you want the driver to log to the same place as WildFly, then you should also create a log4j.xml file in the main directory. You can find an example elsewhere on the web. The <resource-root path="."></resource-root> element is what adds those xml files to the classpath when deployed by WildFly.
Finally, add a new datasource and driver in the <subsystem xmlns="urn:jboss:domain:datasources:2.0"> section. You can do this with the CLI or by directly editing standalone.xml, I did the latter:
<datasource jndi-name="java:jboss/datasources/PhoenixDS" pool-name="PhoenixDS" enabled="true" use-java-context="true">
<connection-url>jdbc:phoenix:first.quorumserver.fqdn,second.quorumserver.fqdn:2181/hbase-secure</connection-url>
<connection-property name="phoenix.connection.autoCommit">true</connection-property>
<driver>phoenix</driver>
<validation>
<check-valid-connection-sql>SELECT 1 FROM SYSTEM.CATALOG LIMIT 1</check-valid-connection-sql>
</validation>
<security>
<security-domain>host</security-domain>
</security>
</datasource>
<drivers>
<driver name="phoenix" module="org.apache.phoenix">
<xa-datasource-class>org.apache.phoenix.jdbc.PhoenixDriver</xa-datasource-class>
</driver>
</drivers>
It's important that you replace first.quorumserver.fqdn,second.quorumserver.fqdn with the correct ZooKeeper quorum string for your environment. You can find this in hbase-site.xml in the HBase configuration directory: hbase.zookeeper.quorum. You don't need to add Kerberos information to the connection URL string!
tl;dr
Make sure that hbase-site.xml and core-site.xml are in your classpath.
Make sure that you have a <security-domain> with a name that ZooKeeper expects (probably "Client"), that uses the com.sun.security.auth.module.Krb5LoginModule.
The Phoenix connection URL must contain the entire ZooKeeper quorum. You can't miss one server out! Make sure it matches the value in hbase-site.xml.
References:
Using Kerberos for Datasource Authentication
Phoenix data source configuration by Mark S

Do multiple resource adapters of different Message providers in Jboss EAP 6.4 share the default bean-instance-pool?

We are using JBoss EAP6.4. In our project we are using two MOMs:
1) Websphere MQ 2) Solace MQ
This is how the resource adapters of two above MOMs our defined in our standalone.xml
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns="urn:jboss:domain:1.7">
<profile>
<subsystem xmlns="urn:jboss:domain:ejb3:1.5">
<mdb>
<resource-adapter-ref resource-adapter-name="wmq.jmsra.rar"/>
<bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
</mdb>
<pools>
<bean-instance-pools>
<strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
</bean-instance-pools>
</pools>
</subsystem>
<subsystem xmlns="urn:jboss:domain:resource-adapters:1.1">
<resource-adapters>
<resource-adapter id="wmq.jmsra.rar">
<archive>wmq.jmsra.rar</archive>
<transaction-support>NoTransaction</transaction-support>
<config-property name="traceLevel">3</config-property>
<config-property name="traceEnabled">true</config-property>
<connection-definitions>
<connection-definition class-name="com.ibm.mq.connector.outbound.ManagedQueueConnectionFactoryImpl" jndi-name="java:jboss/jms/myJMSQueueConnectionFactory" enabled="true" use-java-context="true" pool-name="jms/myJMSQueueConnectionFactoryPool">
<config-property name="channel">${mq.channel}</config-property>
<config-property name="hostName">${mq.host}</config-property>
<config-property name="transportType">${mq.transportType}</config-property>
<config-property name="queueManager">${mq.manager}</config-property>
<config-property name="port">${mq.port}</config-property>
</connection-definition>
</connection-definitions>
<admin-objects>
<admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/jms/abcQueue" enabled="true" use-java-context="true" pool-name="jms/abcQueuePool">
<config-property name="targetClient">MQ</config-property>
<config-property name="persistence">PERS</config-property>
<config-property name="expiry">UNLIMITED</config-property>
<config-property name="baseQueueName">${my.abc.queue}</config-property>
<config-property name="arbitraryProperties">mdMessageContext="2",mdWriteEnabled="true",mdReadEnabled="true"</config-property>
<config-property name="baseQueueManagerName">${mq.manager}</config-property>
</admin-object>
</admin-objects>
</resource-adapter>
<resource-adapter id="com.solacesystems.ra">
<archive>sol-jms-ra-7.1.2.248.rar</archive>
<transaction-support>NoTransaction</transaction-support>
<config-property name="extendedProps">${solace.extendedproperties}</config-property>
<config-property name="UserName">${solace.username}</config-property>
<config-property name="MessageVPN">${solace.vpn}</config-property>
<config-property name="ConnectionURL">${solace.connectionurl}</config-property>
<config-property name="Password">${solace.password}</config-property>
<connection-definitions>
<connection-definition class-name="com.solacesystems.jms.ra.outbound.ManagedJMSConnectionFactory" jndi-name="java:jboss/jms/solaceMessageConnectionFactory" enabled="true" pool-name="solaceMessageCFPool">
<config-property name="ConnectionFactoryJndiName">${solace.connectionfactory}</config-property>
<security>
<application/>
</security>
<validation>
<background-validation>false</background-validation>
</validation>
<recovery>
<recover-credential>
<user-name>${solace.username}</user-name>
<password>${solace.password}</password>
</recover-credential>
</recovery>
</connection-definition>
</connection-definitions>
<admin-objects>
<admin-object class-name="com.solacesystems.jms.ra.outbound.TopicProxy" jndi-name="java:jboss/jms/xyzMessageTopic" enabled="true" use-java-context="false" pool-name="xyzMessageTopicPool">
<config-property name="Destination">${xyz.topic}</config-property>
</admin-object>
</admin-objects>
</resource-adapter>
</resource-adapters>
</subsystem>
</profile>
In above file, basically we have defined two resourceAdapters one for WMQ and one for Solace.
Under <mdb> tag we have defined the default resource adapter name and defined <bean-instance-pool-ref value to limit the instance pool that is used by default for Message Driven Beans.
For few of the MDBs we have explicitly overriden the instance pool value per bean using jboss-ejb3.xml
Since we have multiple message driven beans listening to both WMQ and SOLACE,
My question is:
Will the MDBs (listening to both WMQ queues and SOLACE queues) for which we haven't defined the explicit pool in jboss-ejb3.xml share the same default pool defined under tag i.e.
<mdb>
<resource-adapter-ref resource-adapter-name="wmq.jmsra.rar"/>
<bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
</mdb>
Or is it like default pool will apply only to MDBs listening to WMQ queues.
If the default pool is applied only to MDBs listening to WMQ queues, what happens to MDBs listening to Solace queues that have no pool size defined in either standalone.xml or jboss-ejb3.xml
1) MDBs that do not have an instance pool specified will use the default mdb-strict-max-pool. You can define your own pools (which I recommend):
<pools>
<bean-instance-pools>
<strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
<strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
<strict-max-pool name="MyPool" max-pool-size="10" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
</bean-instance-pools>
</pools>
and then use the annotation:
import org.jboss.ejb3.annotation.Pool;
#Pool(value="MyPool")
in the MDB. This can also be done in the deployment descriptor file.
2) See above. I prefer an instance pool per MDB deployment. I do not like MDBs competing for the instance pool.
3) Same as above. Note that you can see the instance pool name that the MDB deployment is using in JMX. Note that if you have separate instance pools, the pool statistics become much more meaningful.

JGroups ec2 cluster fails to connect (times out) with Hibernate Search / Infinispan setup

I'm trying to set up a distributed Hibernate Search (5.5.4) cluster on my Elastic Beanstalk (Tomcat8) environment, using Infinispan (8.2.4) and JGroups.
I'm currently stuck on an issue where a node can't connect to an existing cluster, and it times out trying to connect.
Starting JGroups channel ISPN
variable "${jgroups.s3.pre_signed_delete_url}" in S3_PING could not be substituted; pre_signed_delete_url is removed from properties
variable "${jgroups.s3.prefix}" in S3_PING could not be substituted; prefix is removed from properties
variable "${jgroups.s3.pre_signed_put_url}" in S3_PING could not be substituted; pre_signed_put_url is removed from properties
ip-172-31-24-216-1799: JOIN(ip-172-31-24-216-1799) sent to ip-172-31-14-33-238 timed out (after 5000 ms), on try 1
ip-172-31-24-216-1799: JOIN(ip-172-31-24-216-1799) sent to ip-172-31-14-33-238 timed out (after 5000 ms), on try 2
...
ip-172-31-24-216-1799: JOIN(ip-172-31-24-216-1799) sent to ip-172-31-14-33-238 timed out (after 5000 ms), on try 10
ip-172-31-24-216-1799: too many JOIN attempts (10): becoming singleton
ISPN000094: Received new cluster view for channel ISPN: [ip-172-31-24-216-Channel ISPN local address is ip-172-31-24-216-1799, physical addresses are [127.0.0.1:7800]
I have enabled all types of inbound traffic within the elastic beanstalk security group, and can successfully ping the other nodes in the group using the internal IP addresses.
This is my infinispan.xml file
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:8.2 http://infinispan.org/schemas/infinispan-config-8.2.xsd"
xmlns="urn:infinispan:config:8.2">
<jgroups>
<stack-file name="default-jgroups-ec2" path="default-configs/default-jgroups-ec2.xml"/>
</jgroups>
<cache-container name="HibernateSearch" default-cache="default" statistics="false" shutdown-hook="DONT_REGISTER">
<transport stack="default-jgroups-ec2"/>
<!-- Duplicate domains are allowed so that multiple deployments with default configuration
of Hibernate Search applications work - if possible it would be better to use JNDI to share
the CacheManager across applications -->
<jmx duplicate-domains="true"/>
<!-- *************************************** -->
<!-- Cache to store Lucene's file metadata -->
<!-- *************************************** -->
<replicated-cache name="LuceneIndexesMetadata" mode="SYNC" remote-timeout="25000">
<locking striping="false" acquire-timeout="10000" concurrency-level="500" write-skew="false"/>
<transaction mode="NONE"/>
<eviction max-entries="-1" strategy="NONE"/>
<expiration max-idle="-1"/>
<persistence>
<file-store path="LuceneIndexes/Metadata" preload="true" />
</persistence>
<indexing index="NONE"/>
<state-transfer enabled="true" timeout="480000" await-initial-transfer="true"/>
</replicated-cache>
<!-- **************************** -->
<!-- Cache to store Lucene data -->
<!-- **************************** -->
<distributed-cache name="LuceneIndexesData" mode="SYNC" remote-timeout="25000">
<locking striping="false" acquire-timeout="10000" concurrency-level="500" write-skew="false"/>
<transaction mode="NONE"/>
<eviction max-entries="-1" strategy="NONE"/>
<expiration max-idle="-1"/>
<persistence>
<file-store path="LuceneIndexes/Data" />
</persistence>
<indexing index="NONE"/>
<state-transfer enabled="true" timeout="480000" await-initial-transfer="true"/>
</distributed-cache>
<!-- ***************************** -->
<!-- Cache to store Lucene locks -->
<!-- ***************************** -->
<replicated-cache name="LuceneIndexesLocking" mode="SYNC" remote-timeout="25000">
<locking striping="false" acquire-timeout="10000" concurrency-level="500" write-skew="false"/>
<transaction mode="NONE"/>
<eviction max-entries="-1" strategy="NONE"/>
<expiration max-idle="-1"/>
<persistence>
<file-store path="LuceneIndexes/Locking" />
</persistence>
<indexing index="NONE"/>
<state-transfer enabled="true" timeout="480000" await-initial-transfer="true"/>
</replicated-cache>
</cache-container>
</infinispan>
And the jgroups config file is the default ec2 config packaged with Infinispan default-jgroups-ec2.xml
Does anyone have any idea of where I may have gone wrong, or what exactly I need to do to get this working?
Your local address is 127.0.0.1:7800, which is the default. This will definitely not work if you need to talk to other nodes.
Also you can see those messages in the logs:
variable "${jgroups.s3.pre_signed_delete_url}" in S3_PING could not be substituted; pre_signed_delete_url is removed from properties
variable "${jgroups.s3.prefix}" in S3_PING could not be substituted; prefix is removed from properties
variable "${jgroups.s3.pre_signed_put_url}" in S3_PING could not be substituted; pre_signed_put_url is removed from properties
You should probably define those variables.

Resources