Trouble with jms-topic
standard Mar 5, 2008 9:10 AMHi,
I have two questions regarding jms-topics.
I defined a service listening on a jms-topic.
The topic is created by another (publisher-) service.
First:
When I define the provider like that:
<jms-provider name="JBossMessaging" connection-factory="ConnectionFactory"> <jms-bus busid="canonicalCourseTopic"> <jms-message-filter dest-type="TOPIC" dest-name="topic/topic_name" />
I get the error that no topic with name "topic/topic_name" is defined,
when I deploy my service.
StackTrace:
javax.jms.JMSException: There is no administratively defined topic with name:topic/topic_name at org.jboss.jms.server.endpoint.ServerSessionEndpoint.createTopic(ServerSessionEndpoint.java:260) at org.jboss.jms.server.endpoint.advised.SessionAdvised.org$jboss$jms$server$endpoint$advised$SessionAdvised$createTopic$aop(SessionAdvised.java:103) at org.jboss.jms.server.endpoint.advised.SessionAdvised$createTopic_N1144803973659535745.invokeNext(SessionAdvised$createTopic_N1144803973659535745.java) at org.jboss.jms.server.container.ServerLogInterceptor.invoke(ServerLogInterceptor.java:105) at org.jboss.jms.server.endpoint.advised.SessionAdvised$createTopic_N1144803973659535745.invokeNext(SessionAdvised$createTopic_N1144803973659535745.java) at org.jboss.jms.server.endpoint.advised.SessionAdvised.createTopic(SessionAdvised.java) at org.jboss.jms.wireformat.SessionCreateTopicRequest.serverInvoke(SessionCreateTopicRequest.java:74) at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:141) at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734) at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:101) at org.jboss.remoting.Client.invoke(Client.java:1550) at org.jboss.remoting.Client.invoke(Client.java:530) at org.jboss.remoting.Client.invoke(Client.java:518) at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:186) at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:157) at org.jboss.jms.client.delegate.ClientSessionDelegate.org$jboss$jms$client$delegate$ClientSessionDelegate$createTopic$aop(ClientSessionDelegate.java:316) at org.jboss.jms.client.delegate.ClientSessionDelegate$createTopic_N1144803973659535745.invokeNext(ClientSessionDelegate$createTopic_N1144803973659535745.java) at org.jboss.jms.client.container.FailoverValveInterceptor.invoke(FailoverValveInterceptor.java:91) at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105) at org.jboss.jms.client.delegate.ClientSessionDelegate$createTopic_N1144803973659535745.invokeNext(ClientSessionDelegate$createTopic_N1144803973659535745.java) at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170) at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105) at org.jboss.jms.client.delegate.ClientSessionDelegate$createTopic_N1144803973659535745.invokeNext(ClientSessionDelegate$createTopic_N1144803973659535745.java) at org.jboss.jms.client.delegate.ClientSessionDelegate.createTopic(ClientSessionDelegate.java) at org.jboss.jms.client.JBossSession.createTopic(JBossSession.java:260) at org.jboss.internal.soa.esb.couriers.JmsCourier.createMessageConsumer(JmsCourier.java:440) at org.jboss.internal.soa.esb.couriers.JmsCourier.pickup(JmsCourier.java:316) at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:223) at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:205) at org.jboss.soa.esb.listeners.message.MessageAwareListener.waitForEventAndProcess(MessageAwareListener.java:268) at org.jboss.soa.esb.listeners.message.MessageAwareListener.doRun(MessageAwareListener.java:252) at org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle.run(AbstractThreadedManagedLifecycle.java:115) at java.lang.Thread.run(Thread.java:595)
But when I define the provider like that:
<jms-provider name="JBossMessaging" connection-factory="ConnectionFactory"> <jms-bus busid="canonicalCourseTopic"> <jms-message-filter dest-type="TOPIC" dest-name="topic_name" />
without the "topic/" I don't get that error.
With my queues I always define the provider with "queue/queue_name",
and in the jms-topic quickstart, the provider is also defined with "topic/topic_name".
Whats the right way to define the providers, or is this just a bug in my ESB version?
ESB version is: jbossesb-server-4.2GA
Second:
When I want so publish a TextMessage inside the publisher-service like that:
TopicSession ts; TopicPublisher tp; TopicConnection tc; Topic topic; TopicConnectionFactory tcf; Context jndiContext = new InitialContext(); tcf = (TopicConnectionFactory) jndiContext.lookup("ConnectionFactory"); topic = (Topic) jndiContext.lookup(topicName); tc = tcf.createTopicConnection(); ts = tc.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); tp = ts.createPublisher(topic); tc.start(); String text = someXMLasString; TextMessage textMessage = ts.createTextMessage(text); tp.publish(topic, textMessage);
I get the Error (no Exception):
14:44:58,562 ERROR [JmsCourier] Unsupported JMS message type: org.jboss.jms.message.TextMessageProxy
Isn't that the right way to do it? What can I do to work around this?
Thanks
Andreas