Hi,
I've created a client program that publishes objectMessages to queues, and after 100 times, I keep on getting the following message:
WARNING: com.sun.messaging.jms.JMSException: [ADD_PRODUCER_REPLY(19)] [C4036]: A broker error occurred. :[409] [B4183]: Producer can not be added to destination inputQueue [Queue], limit of 100 producers would be exceeded
I'm using Glassfish V2, Open MQ jms and sun-jms-adapter. I've seen in some sun docs, that I can perfectly change the maxNumberOfProducer in using admin commando lines, but I could not find anywhere what does this number mean. If it meant to be the maximum number of ACTIVE producers, something is strange because I dont have this number of producers trying to produce messages simoutaneously. Besides, I'm closing my session, my producer and my connection every time I send a new message.
On the other hand, if this number meant to be the maximum number of times I can produce messages to a queue, then it doesn't make any sense at all... Why would I want that?
Can anybody please help me? Here is the pice of code where I create a producer and send a message to my queue:
QueueSession queueSession = null;
ObjectMessage message = null;
Queue queue = null;
QueueSender queueSender = null;
QueueConnection connection = null;
try {
connection = queueConnectionFactory.createQueueConnection();
queueSession = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
// Create an object message
message = queueSession.createObjectMessage(object);
queue = (QueueConnectionFactory) InitialContext
.doLookup(destination);
// create producer
queueSender = queueSession.createSender(queue);
queueSender.send(message);
} catch (Exception e) {
logger.severe("error while sending message: " + e.getMessage());
} finally {
try {
if (queueSender != null) {
queueSender.close();
}
if (queueSession != null) {
queueSession.close();
}
if (connection != null) {
connection.close();
}
} catch (JMSException ex) {
logger.severe("Could not close resources. " + ex.getMessage());
}
queueSession = null;
message = null;
destination = null;
queueSender = null;
queue = null;
connection = null;
}
Thnak you!