ApacheMQ Provider [message #1016807] |
Thu, 07 March 2013 13:11  |
Eclipse User |
|
|
|
Phew. Can't get ApacheMQ to work.
I start ApacheMQ 5.3.2 on localhost at 61616
Then I start ActiveMQ JMS Server from org.eclipse.ecf.provider.jms.activemq pointing at tcp://localhost:61616/uk-co-xlegal-liveshow-annotation?wireFormat.maxInactivityDuration=0&wireFormat.maxInactivityDurationInitalDelay=10000
No logging of any connection
Next I get a container and connect it - but no connection is logged at ApacheMQ, nor is any containerconnectedevent generated
I suspect that neither the server nor the client is connecting. I suspect that I am missing a step here.
Any ideas?
IContainer container = manager.getContainerFactory().createContainer("ecf.jms.activemq.tcp.client", new Object[]{"tcp://localhost:61616/uk-co-xlegal-liveshow-annotation?wireFormat.maxInactivityDuration=0", "1000000"});
final ISharedObjectContainer soc = (ISharedObjectContainer) ((IAdaptable) container).getAdapter(ISharedObjectContainer.
soc.addListener(new IContainerListener() {
@Override
public void handleEvent(
IContainerEvent event) {
System.out.println(event.getClass().getName());
if (event instanceof IContainerConnectedEvent)
try {
ISharedObjectManager manager = soc.getSharedObjectManager();
admin = new DistributedEventAdmin(context);
ID id1 = IDFactory.getDefault().createStringID("uk.co.xlegal.xbundle3.remote");
Properties props = new Properties();
props.put(EventConstants.EVENT_TOPIC, "uk_co_xlegal_xbundle3_remote");
manager.addSharedObject(id1, (ISharedObject) admin, props);
((DistributedEventAdmin) admin).start();
} catch (Exception e) {
Log.log(Log.ERROR, e.getMessage());
}
}
});
ID targetId = IDFactory.getDefault().createID(container.getConnectNamespace(), container.getID().getName());
container.connect(targetId, null);
|
|
|
|
Re: ApacheMQ Provider [message #1016818 is a reply to message #1016813] |
Thu, 07 March 2013 14:18  |
Eclipse User |
|
|
|
Hi Robert,
I just tried locally (using the AbstractEventAdminApplication) creating/starting the ECF JMS server container (i.e. containerType ecf.jms.activemq.tcp.manager), with this as the value for containerId
tcp://localhost:61616/uk-co-xlegal-liveshow-annotation?wireFormat.maxInactivityDuration=0&wireFormat.maxInactivityDurationInitalDelay=10000
When I create the server container with this, it this is printed in the console (ActiveMQ bug):
Mar 07, 2013 11:08:21 AM org.apache.activemq.transport.tcp.TcpTransportFactory createTransport
WARNING: path isn't a valid local location for TcpTransport to use
java.lang.NumberFormatException: For input string: "/uk-co-xlegal-liveshow-annotation"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:481)
at java.lang.Integer.parseInt(Integer.java:527)
at org.apache.activemq.transport.tcp.TcpTransportFactory.createTransport(TcpTransportFactory.java:136)
at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:141)
at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:51)
at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:80)
at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:243)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:230)
at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:178)
at org.eclipse.ecf.provider.jms.channel.AbstractJMSChannel.setupJMS(AbstractJMSChannel.java:161)
at org.eclipse.ecf.provider.jms.channel.AbstractJMSServerChannel.<init>(AbstractJMSServerChannel.java:35)
at org.eclipse.ecf.provider.jms.activemq.container.ActiveMQServerChannel.<init>(ActiveMQServerChannel.java:25)
at org.eclipse.ecf.provider.jms.activemq.container.ActiveMQJMSServerContainer.start(ActiveMQJMSServerContainer.java:40)
at org.eclipse.ecf.internal.provider.jms.activemq.ActiveMQJMSServerContainerInstantiator.createInstance(ActiveMQJMSServerContainerInstantiator.java:64)
at org.eclipse.ecf.core.ContainerFactory.createContainer(ContainerFactory.java:296)
at org.eclipse.ecf.core.ContainerFactory.createContainer(ContainerFactory.java:315)
at org.eclipse.ecf.examples.internal.eventadmin.app.AbstractEventAdminApplication.createConfigureAndConnectContainer(AbstractEventAdminApplication.java:157)
at org.eclipse.ecf.examples.internal.eventadmin.app.AbstractEventAdminApplication.startup(AbstractEventAdminApplication.java:65)
at org.eclipse.ecf.examples.internal.eventadmin.app.AbstractEventAdminApplication.start(AbstractEventAdminApplication.java:105)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
at java.lang.Thread.run(Thread.java:722)
And, when I consult the active mq admin webapp I see that this topic has been added:
uk-co-xlegal-liveshow-annotation
If I let just the server run, the test/example sender starts sending and handling/displaying these events:
handleEvent
topic=defaultTopic
message=message #58
sender=tcp://localhost:61616/uk-co-xlegal-liveshow-annotation?wireFormat.maxInactivityDuration=0&wireFormat.maxInactivityDurationInitalDelay=10000
handleEvent
topic=defaultTopic
message=message #59
sender=tcp://localhost:61616/uk-co-xlegal-liveshow-annotation?wireFormat.maxInactivityDuration=0&wireFormat.maxInactivityDurationInitalDelay=10000
handleEvent
topic=defaultTopic
message=message #60
sender=tcp://localhost:61616/uk-co-xlegal-liveshow-annotation?wireFormat.maxInactivityDuration=0&wireFormat.maxInactivityDurationInitalDelay=10000
To summarize...so far I'm not reproducing the issue with the server (not connecting to the ActiveMQ broker)...so it might be something specific to either your startup code or your environment. If you are able to share your server code I would be happy to give it a try./help debug. If you with to do so it might be better to attach to a new ECF bug, rather than post it here on the forum.
|
|
|
Powered by
FUDForum. Page generated in 0.03084 seconds