I am having some problems indicating an example in hornetq-2.3.0.Final jar in the main folder named Embedded-Remote, I am trying to run the example in a "remote environment", using for these two computers on the same local network, if I launched two classes without changing anything on the same computer, "EmbeddedRemotExample.java" works fine, but since there are no configuration files in this example, I'm not sure how to set this class to connect to a server running on another computer. after reading the api, I found that this is valid code:
`
HashMap map = new HashMap(); map.put("host", "192.168.XXX.XXX"); map.put("port", 5445); ServerLocator serverLocator = HornetQClient.createServerLocatorWithoutHA( new TransportConfiguration(NettyConnectorFactory.class.getName(),map)); ClientSessionFactory sf = serverLocator.createSessionFactory();`
but this throws the following exception
HornetQException[errorType=NOT_CONNECTED message=HQ119007: Cannot connect to server(s). Tried with all available servers.] at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:852) at org.hornetq.core.example.EmbeddedRemoteExample.main(EmbeddedRemoteExample.java:49)`
How can I customize this specific example?
on one computer: org.hornetq.core.example.EmbeddedServer
in another: org.hornetq.core.example.EmbeddedRemoteExample
source share