Note that there are some explanatory texts on larger screens.

plurals
  1. POgetting error while publishing message to Message Broker's Topic from esb's Proxy
    primarykey
    data
    text
    <p>Whenever i try to publish a message from esb to message broker's topic, i get this error</p> <pre><code>[2013-04-19 14:51:45,930] ERROR - AMQConnection Throwable Received but no listener set: org.wso2.andes.client.AMQNoRoute Exception: Error: No Route for message [error code 312: no route] </code></pre> <p>My proxy code is</p> <pre><code> &lt;proxy name="SendMessageProxy" transports="http" startOnLoad="true"&gt; &lt;target&gt; &lt;endpoint&gt; &lt;address uri="jms:/myTopic?&amp;amp;transport.jms.DestinationType=topic"/&gt; &lt;/endpoint&gt; &lt;inSequence&gt; &lt;log level="custom"&gt; &lt;property name="STATE" value="message is sent to queue"/&gt; &lt;/log&gt; &lt;property name="OUT_ONLY" value="true"/&gt; &lt;property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/&gt; &lt;/inSequence&gt; &lt;outSequence/&gt; &lt;/target&gt; &lt;/proxy&gt;` </code></pre> <p>My jndi configuration and axis 2 configuration are properly configured.My MB is running on port 9444 and Publisher_esb is running on 9443 and subscriber esb is running at port 9446. When i keep my subscriber active and then if i post a message from my publisher the message gets reflected to the subsciber.</p> <p>Code to get message from subscriber is</p> <pre><code>package xml.parser; import org.w3c.dom.*; import javax.xml.xpath.*; import javax.xml.namespace.NamespaceContext; import javax.xml.parsers.*; import java.io.IOException; import java.util.Enumeration; import java.util.Iterator; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import javax.jms.*; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import java.util.Properties; public class Parser { public static final String QPID_ICF = "org.wso2.andes.jndi.PropertiesFileInitialContextFactory"; private static final String CF_NAME_PREFIX = "connectionfactory."; private static final String CF_NAME = "qpidConnectionfactory"; String userName = "admin"; String password = "admin"; private static String CARBON_CLIENT_ID = "carbon"; private static String CARBON_VIRTUAL_HOST_NAME = "carbon"; private static String CARBON_DEFAULT_HOSTNAME = "localhost"; private static String CARBON_BROKER_PORT = "5673"; String topicName = "myTopic"; public static void main(String[] args) throws NamingException, JMSException, XPathExpressionException, ParserConfigurationException, SAXException, IOException { Parser queueReceiver = new Parser(); String message = queueReceiver.subscribe(); } public String subscribe() throws NamingException, JMSException { String messageContent = ""; Properties properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, QPID_ICF); properties.put(CF_NAME_PREFIX + CF_NAME, getTCPConnectionURL(userName, password)); properties.put("topic." + topicName, topicName); System.out.println("getTCPConnectionURL(userName,password) = " + getTCPConnectionURL(userName, password)); InitialContext ctx = new InitialContext(properties); // Lookup connection factory TopicConnectionFactory connFactory = (TopicConnectionFactory) ctx .lookup(CF_NAME); TopicConnection topicConnection = connFactory.createTopicConnection(); topicConnection.start(); TopicSession topicSession = topicConnection.createTopicSession(false, QueueSession.AUTO_ACKNOWLEDGE); // Send message //Topic topic = topicSession.createTopic(topicName); Topic topic = (Topic) ctx.lookup(topicName); javax.jms.TopicSubscriber topicSubscriber = topicSession .createDurableSubscriber(topic,"admin"); Message message = topicSubscriber.receive(); if (message instanceof TextMessage) { TextMessage textMessage = (TextMessage) message; System.out.println("textMessage.getText() = " + textMessage.getText()); messageContent = textMessage.getText(); } topicSession.close(); topicConnection.close(); return messageContent; } public String getTCPConnectionURL(String username, String password) { return new StringBuffer().append("amqp://").append(username) .append(":").append(password).append("@") .append(CARBON_CLIENT_ID).append("/") .append(CARBON_VIRTUAL_HOST_NAME).append("?brokerlist='tcp://") .append(CARBON_DEFAULT_HOSTNAME).append(":") .append(CARBON_BROKER_PORT).append("'").toString(); } } </code></pre> <p>Whne i ran the subscriber for the first time it gave me the result but after that it is giving exception as:</p> <pre><code>[2013-04-19 17:24:26,947] ERROR {org.wso2.andes.transport.network.mina.MinaNetworkHandler} - Exception caught by Mina java.io.IOException: An existing connection was forcibly closed by the remote host at sun.nio.ch.SocketDispatcher.read0(Native Method) at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:218) at sun.nio.ch.IOUtil.read(IOUtil.java:191) at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:359) at org.apache.mina.transport.socket.nio.SocketIoProcessor.read(SocketIoProcessor.java:218) at org.apache.mina.transport.socket.nio.SocketIoProcessor.process(SocketIoProcessor.java:198) at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$400(SocketIoProcessor.java:45) at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:485) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51) at java.lang.Thread.run(Thread.java:722) [2013-04-19 17:24:26,957] ERROR {org.wso2.andes.server.protocol.AMQProtocolEngine} - IOException caught in/127.0.0.1:16 513(admin), session closed implictly: java.io.IOException: An existing connection was forcibly closed by the remote host [2013-04-19 17:33:40,283] INFO {org.wso2.andes.server.protocol.AMQProtocolEngine} - Closing channel due to: Cannot sub scribe to queue carbon:admin as it already has an existing exclusive consumer [2013-04-19 17:33:40,283] INFO {org.wso2.andes.server.protocol.AMQProtocolEngine} - Channel[1] awaiting closure - proc essing close-ok [2013-04-19 17:33:40,283] INFO {org.wso2.andes.server.handler.ChannelCloseOkHandler} - Received channel-close-ok for c hannel-id 1 [2013-04-19 17:40:48,867] INFO {org.wso2.andes.server.queue.SimpleAMQQueue} - Auto-deleteing queue:tmp_127_0_0_1_16587 _1 </code></pre> <p>Can't i post messages to the topic without making my subscriber active. How can i make my message durable or persistent? And one more question i have is: How can i get the queueName associated with the topic that i created aor can i create a queue specifically for my topic myTopic? Looking forward to your answers. Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload