-
1. Re: JNDI lookup for Hornetq in Jboss6
ataylor Dec 5, 2012 4:20 AM (in response to grandhivenkatesh8787)without any more info its impossible to help you, no doubt its a configuration issue somewhere, make sure that the connectors and acceptors are configured correctly.
-
2. Re: JNDI lookup for Hornetq in Jboss6
grandhivenkatesh8787 Dec 5, 2012 4:29 AM (in response to ataylor)Andy Taylor wrote:
without any more info its impossible to help you, no doubt its a configuration issue somewhere, make sure that the connectors and acceptors are configured correctly.
Hi Andy...the jboss 6 has some default configurations of horentq...and I am using the default one(localhost)...i have provide the configuration of it...
-
configurations.zip 3.4 KB
-
-
3. Re: JNDI lookup for Hornetq in Jboss6
ataylor Dec 5, 2012 9:28 AM (in response to grandhivenkatesh8787)its impossible for me to see what happening, I would suggest starting with some of the examples and go from there
-
4. Re: JNDI lookup for Hornetq in Jboss6
grandhivenkatesh8787 Dec 5, 2012 11:14 AM (in response to ataylor)Andy Taylor wrote:
its impossible for me to see what happening, I would suggest starting with some of the examples and go from there
I have tried the examples in Hornetq standalone...for my requirement i need to use the in-built horentq of Jboss 6.1.0.When we run a Jboss 6.1.0...it gives default configured queues...DLQ,ExpiryQueue and also i have configured exampleQueue,exampleTopic as Queue and Topic names respectively..so I need to use these for publish and subscribe...while I push some messages...I am unable to create the session factory....
I'm attaching the Sample Code to push some messages to the queue..please correct me if I'm wrong....and as a runtime argument I'm passing http://127.0.0.1:8080/invoker/JNDIFactoryt to the program
-
QueueSend.zip 1.0 KB
-
-
5. Re: JNDI lookup for Hornetq in Jboss6
ataylor Dec 6, 2012 7:41 AM (in response to grandhivenkatesh8787)I have no idea, make sure you are using the correct client libs
-
6. Re: JNDI lookup for Hornetq in Jboss6
tnas Dec 18, 2012 2:49 PM (in response to grandhivenkatesh8787)I'm stuck at this same problem. Could someone help us?
-
7. Re: JNDI lookup for Hornetq in Jboss6
jbertram Dec 18, 2012 3:01 PM (in response to tnas)Can you be more specific (e.g. provide your client code and configuration)?
-
8. Re: JNDI lookup for Hornetq in Jboss6
tnas Dec 19, 2012 9:39 AM (in response to jbertram)Hi,
It's the code I'm using. I've removed try/catch just to simplify the post here.
public class Publisher {
private static ConnectionFactory connectionFactory;
private static Topic topic;
private static final byte NUM_MSG = 5;
public void publish() {
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
Connection connection = null;
Context ctx = new InitialContext(env);
connectionFactory = (TopicConnectionFactory) ctx.lookup("/ConnectionFactory");
topic = (Topic) ctx.lookup("/jms/MyTopic");
Destination dest = topic;
connection = connectionFactory.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(dest);
TextMessage message = session.createTextMessage();
for (int nMsg = 1; nMsg <= NUM_MSG; ++nMsg) {
message.setText("This is a message " + nMsg + " from de Publisher.");
System.out.println("Sending message: " + message.getText());
producer.send(message);
}
}
<configuration xmlns="urn:hornetq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq ../schemas/hornetq-jms.xsd ">
<connection-factory name="ConnectionFactory">
<connectors>
<connector-ref connector-name="netty"/>
</connectors>
<entries>
<entry name="ConnectionFactory"/>
</entries>
</connection-factory>
<topic name="MyTopic">
<entry name="/jms/MyTopic"/>
</topic>
</configuration>