I have a local InitialContext() and have used this to create a local QueueConnection, QueueSession, and local consumer(QueueReceiver) to receive messages on a local receive Queue. My local producer(QueueSender) is to send to a remote destination but the jndi lookup is failing as (I think) the jndi name has no information about the location of the remote server.
My code is this:
QueueSender sender = localQueueSession.createSender(remoteQueue);
(javax.jms.InvalidDestinationException: This destination does not exist! QUEUE.remotequeuename)
QueueSender sender = remoteQueueSession.createSender(remoteQueue);
ObjectMessage om = remoteQueueSession.createObjectMessage(message);