File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubts regarding JMS in Jboss

 
maha laxmi
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) my code if i use QueueConnectionFactory then i got QueueConnectionFactory not bound exception then i replaced with ConnectionFactory;what's the difference between these two.

QueueConnectionFactory conFactory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");

QueueConnectionFactory conFactory = (QueueConnectionFactory) ctx.lookup("QueueConnectionFactory");

2)what is difference between if i specify this in ejb-jar.xml;if i write javax.jms.Topic it didnt worked;

<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>
and

<message-driven-destination>
<destination-type>javax.jms.Topic</destination-type
</message-driven-destination>



3)

do i need to set up environment properties in client ;if i dont write this i am getting Received time out error.

Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming rg.jnp.interfaces");
env.put(Context.PROVIDER_URL,"jnp://localhost:1099");


Context ctx = new InitialContext(env);

// Lookup a JMS connection factory
QueueConnectionFactory conFactory = (QueueConnectionFactory) ctx.lookup(CONNECTION_FACTORY);


4) i heard that when you want to work some operation thru offline then you should use JMS.what is offline??

5)

i know its queque name described in jbossmq-destinations-service.xml;whats the purpose of creating queue???

i think it just send messages to the MyQueue;

<destination-jndi-name>queue/MyQueue</destination-jndi-name>
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) my code if i use QueueConnectionFactory then i got QueueConnectionFactory not bound exception then i replaced with ConnectionFactory;what's the difference between these two.


If lookup has to been successful the ConnectionFactory object has to be bound by the name you lookup.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic