-
Notifications
You must be signed in to change notification settings - Fork 914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support useTopologyForLoadBalancing on JMS ConnectionFactory urls #2286
Conversation
Change-Id: I71ec5be35f8df22ddf1718ca8cb7e8da3906ba4b
Test cases needed to cover new feature, also documentation needed to describe the feature for others |
This is an existing feature, I just exposed it so its usable on urls of ConnectionFactory. Existing documentation is at https://activemq.apache.org/artemis/docs/latest/clusters.html#client-side-load-balancing Im trying to add a testcase/logic to org.apache.activemq.artemis.tests.integration.cluster.distribution.NettySymmetricClusterTest which was added by the original pull request but Im having trouble getting that to execute locally. When I run
I'm getting [INFO] ------------------------------------------------------------------------ Can you point me to the right direction... Thanks |
I usually just use the IDE to run tests... But you probably need to build the project before running the test? |
TBH: This currently works already. you don't need to expose the property. The URI is used to create the serverLocator, and it will be set on it already. |
When I was running on debug mode, it was actually hitting org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.ActiveMQConnectionFactory(boolean, TransportConfiguration...) instead of org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.ActiveMQConnectionFactory(ServerLocator) so useTopologyForLoadBalancing was not being set on the ServerLocator. I was using the following to get the ConnectionFactory
|
Why don't you just use cf = new ActiveMQConnectionFActory(uri); ? |
anyway.. if you add the property.. also add the getter.. as the externalize will it. |
The existing code has the ConnectionFactory lookup via jndi, we're migrating from a different JMS provider(JBoss Messaging). |
@mvtorres, how is JNDI being configured? |
This is the config, our app is currently running on jboss 4.3.
Artemis is running inside docker, with the connector dynamically set to the docker container ip. |
OK. I see now where this isn't being passed through when used for a JMS connection factory, although using the property in the URL for a
|
@jbertram I think the right fix is on the Schemas... @Override
protected ActiveMQConnectionFactory internalNewObject(URI uri,
Map<String, String> query,
String name) throws Exception {
JMSConnectionOptions options = newConectionOptions(uri, query);
ActiveMQConnectionFactory factory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(options.getFactoryTypeEnum(), InVMTransportConfigurationSchema.createTransportConfiguration(uri, query, name, "org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory"));
BeanSupport.setData(uri, factory, query);
BeanSupport.setData(uri, factory.getServerLocator(), query);
return factory;
} |
Please look at #2292 |
This closes apache#2286 As it superceedes it
Thanks for the fix. |
This closes apache#2286 As it superceedes it
This closes apache#2286 As it superceedes it (cherry picked from commit d2d9a0e) (cherry picked from commit 1ff80a8)
This closes apache#2286 As it superceedes it
This closes apache#2286 As it superceedes it
No description provided.