I’m running an embedded HornetQ server on an OSGI container following an example for embedded HornetQ Core.
I have three OSGI containers: one for the server, one for a producer and a last one for a consumer. Everything works on local.
The code I’m using in both the producer and consumer for connecting to the server is the following:
// Step 4. As we are not using a JNDI environment we instantiate the objects directly
ServerLocator serverLocator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName()));
ClientSessionFactory sf = serverLocator.createSessionFactory();
I’ve tried looking at the TransportConfiguration methods, but no setter was found.
You need to pass parameters to the Transport configuration:
Notice you have / could do the same to the
NettyAcceptor. I’m not sure how you are configuring the acceptors at your test.. but I hope you get the idea.