Hi,
I can't find any documentation on how to administer JMS. What I am looking for is how
to determine which Queues and/or Topics exist on the server. This is needed so I can
figure out why I am not able to send messages on orion. I am using docs from the JMS
specification and its not working. Attached is a code snippet:
void someMethod()
{
queueConnectionFactory = (QueueConnectionFactory)new
InitialContext().lookup("java:comp/env/jms/theQueueConnectionFactory");
queueConnection = queueConnectionFactory.createQueueConnection();
queueConnection.start();
queueSession = queueConnection.createQueueSession(false,
Session.CLIENT_ACKNOWLEDGE);
queue = queueSession.createQueue(<some name>);
queueSender = queueSession.createSender(queue);
< i may set a filter here>
queueReceiver = queueSession.createReceiver(queue);
queueReceiver.setMessageListener(new JmsMessageHandler());
BytesMessage bytesMessage;
try
{
bytesMessage = queueSession.createBytesMessage();
bytesMessage.writeInt(bytes.length);
bytesMessage.writeBytes(bytes);
< i may set properties here>
queueSender.send(bytesMessage, DeliveryMode.NON_PERSISTENT,
Message.DEFAULT_PRIORITY, 10000);
}
catch (<whatever>)
{
}
}
class JmsMessageHandler implements MessageListener
{
public void onMessage(javax.jms.Message message)
{
if (message instanceof BytesMessage)
{
< do something>
}
}
}
This code works fine with Suns JMQ product (except that I use a different method to
create the connection factory with JMQ). I added the jndi.properties file and the
correct xml files (it complained until I added them). The application runs without
errors, but no messages are being sent/recieved.
Any help would be greatly appreciated!