0

I am sending a message to ActiveMQ Artemis's queue with Qpid protocol,if I use below codes that can success

ConnectionFactory connectionFactory = new JmsConnectionFactory("amqp://localhost:5672");

But when I use this way that will fail:

Context initialContext = new InitialContext();
factory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");

and below code is jndi.properties:

java.naming.factory.initial=org.apache.qpid.jms.jndi.JmsInitialContextFactory
connectionFactory.ConnectionFactory=amqp://localhost:5672
queue.queue/myqueue=otd-aps

Could anyone help me resolve it? Thx!

JoeXu
  • 41
  • 1
  • 8
  • The error in the title doesn't relate in any way to the code snippets you've given around connections, please clarify your question. – Tim Bish Jul 27 '17 at 13:38
  • Thanks for answering my question.I had found the answer that I used a wrong queue name.The name should be jms.queue.otd-aps,this is a full name of queue.when using amqp to connect the queue , the name should be fully otherwise not fully. – JoeXu Jul 29 '17 at 16:12

1 Answers1

0

Maybe the Queue or Topic that you are sending don't exist on server, and your client don't have permission of creation.

lucasddaniel
  • 1,779
  • 22
  • 22