Closed vsevel closed 2 months ago
Is this a known issue/feature in the artemis-ra @clebertsuconic?
Never seen that in our eap clusters
Is this actually hornetq. Clustering is not actually related RA
Is this actually hornetq. Clustering is not actually related RA
I have problems to categorize the issue and your statement. Does this mean this isn't on "our" (quarkus-artemis
) end?
@zhfeng are you able to determine whether this is something on our end?
Is this actually hornetq. Clustering is not actually related RA
@clebertsuconic apologies, I thought it was because of the configuration that is passed to the RA:
quarkus.ironjacamar.ra.config.connection-parameters=host=x1;port=...,host=x2;port=...;protocols=CORE
I haven't checked the sources, but looking at the stacktrace it seems to originate from the Artemis Client used internally while creating the SessionFactory
@turing85 I guess it could be related to quarkus-ironjacamar
or artemis-ra
.
@vsevel Is it possible to enable the TRACE log? it could be helpful to check if all of the hosts have been tried to connect?
when I look at the ActiveMQResourceAdapter
instance, I can see the unparsedProperties=host=x2;port=...,host=x2;port=...;protocols=CORE
but the defaultActiveMQConnectionFactory
is only: ActiveMQConnectionFactory [serverLocator=ServerLocatorImpl [initialConnectors=[TransportConfiguration(name=b5ca45d6-4a86-11ef-a31c-00155d61c210, factory=org-apache-activemq-artemis-core-remoting-impl-netty-NettyConnectorFactory)?port=...&host=x1], discoveryGroupConfiguration=null], clientID=null, consumerWindowSize=1048576, dupsOKBatchSize=1048576, transactionBatchSize=1048576, readOnly=false, EnableSharedClientID=true]
only the first host is in the initial connectors.
is quarkus.ironjacamar.ra.config.connection-parameters=host=x1;port=...,host=x2;port=...;protocols=CORE
the correct syntax?
in ArtemisResourceAdapterFactory
we have:
public ActiveMQResourceAdapter createResourceAdapter(String id, Map<String, String> config) {
ActiveMQResourceAdapter adapter = new ActiveMQResourceAdapter();
adapter.setConnectorClassName(NettyConnectorFactory.class.getName());
adapter.setConnectionParameters((String)config.get("connection-parameters"));
but later in ActiveMQResourceAdapter
we build one transport configuration per connector class name:
} else if (connectorClassName != null) {
TransportConfiguration[] transportConfigurations = new TransportConfiguration[connectorClassName.size()];
...
for (int i = 0; i < connectorClassName.size(); i++) {
TransportConfiguration tc;
if (connectionParams == null || i >= connectionParams.size()) {
tc = new TransportConfiguration(connectorClassName.get(i));
logger.debug("No connector params provided using default");
} else {
tc = new TransportConfiguration(connectorClassName.get(i), connectionParams.get(i));
}
transportConfigurations[i] = tc;
}
instead of adapter.setConnectorClassName(NettyConnectorFactory.class.getName());
, we should be passing org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory,org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory
for both hosts to be recognized?
@vsevel that looks weird, but if that's how the adapter works, maybe it's acceptable. Can you test with a custom ResourceAdapterFactory and let us know how that works?
I confirm that if I intercept the code in:
public void setConnectorClassName(final String connectorClassName) {
logger.trace("setTransportType({})", connectorClassName);
and change the connectorClassName
to "org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory,org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory"
, then it works as expected.
you either need to pass as many NettyConnectorFactory
as you see there are connection parameters, or make the connector class name a configurable variable.
@vsevel since you found the root cause, do you want to submit a PR with the fix?
I went ahead and created #572, see if that works for you
thanks @gastaldi I will have a look early next week
@all-contributors please add @vsevel for bug
@turing85
I've put up a pull request to add @vsevel! :tada:
thanks @gastaldi
@vsevel is it okay if we hold back the release until quarkus 3.13.0
reaches GA (and camel-quarkus
version 3.13.0
lands)?
thanks @gastaldi
Thank you for doing the hardest part of investigating 😉
is it okay if we hold back the release until quarkus 3.13.0 reaches GA (and camel-quarkus version 3.13.0 lands)?
yes @turing85
problem description
I have created a quarkus app connecting to a hornetq cluster, and sending a message every 5 seconds. if both hornetq nodes are up, and I start the application, I can send my messages OK. if I shut down node
x1
, and I start the application, no messages get sent at all, and the following exception gets logged every time the scheduler gets called, and no messages get sent:The application has the following configuration:
if I exchange
x1
andx2
then it works:this only fails when the failed node is first in the url.
expectation
the client should be able to connect to any running node.
producer code
pom
cc @gastaldi @zhfeng