Hello all,
We use Jboss3.2.3 on a Solaris 5.9 on our production environment.
There are two servers that we use in a cluster.
We have a JMS queue from which an MDB listens to and executes application
logic. There are 0 retries configured for the MDB.
The message posted is a text message with no properties set on it.
Whenever an exception is thrown, the messages are sent back to DLQ.
While investigating the current issues we have found the problems with the
application logic and fixed it.
The problem is at times we see the messages in DLQ being shown as 0. We
verified it through the queue Depth attribute on the MBean. These Messages are
still present in the database as we use Oracle Data base for persistence.
We have observed that after restart of the server, the queue depth restores
back to the original numbers.
We have ascertained manually that no messages have been lost yet
Can anybody explain why this happens?
The Code snippets below will provide more details.
=
To allow for resubmission of selective messages, we have provided the users
with a utility to submit selective messages.
1) We use a queue browser to display the messages. Users select the required
messages, which can be in any arbitrary order in the queue and resubmit them.
String strProviderURL = "jnp://" + strIPAddress + ":1099";
| Hashtable htServerConfig = new Hashtable();
| htServerConfig.put(Context.INITIAL_CONTEXT_FACTORY,
| "org.jnp.interfaces.NamingContextFactory");
|
| htServerConfig.put(Context.PROVIDER_URL, strProviderURL);
| objContext = new InitialContext(htServerConfig);
| objQueueConnectionFactory =
(QueueConnectionFactory)objContext.lookup("OIL2XAConnectionFactory");
|
| objQueueConnection =
(QueueConnection)objQueueConnectionFactory.createQueueConnection();
| objQueueConnection.start();
|
| objQueueSession = objQueueConnection.createQueueSession(false,
Session.CLIENT_ACKNOWLEDGE);
|
| //Creat the queue session and queues
| objDLQueue = (Queue)objContext.lookup(strDLQName);
|
| //QueueReceiver objQueueReceiver =
objQueueSession.createReceiver(objDLQueue);
|
| objQueueBrowser = objQueueSession.createBrowser(objDLQueue);final
Enumeration enumMessages = objQueueBrowser.getEnumeration();
|
|
| TextMessage textMessage = null;
| Message message = null;
| long lDate ;
| String strWPId = null;
| final ArrayList alMessages = new ArrayList();
| Message[] messages = null;
|
| while (enumMessages.hasMoreElements()) {
| textMessage = (TextMessage)enumMessages.nextElement();
| message = new Message();
| try {
| strWPId = textMessage.getText();
strWPId is the string that we are intersted in
browse through the Q, check if the message is the one that user has requested
to resubmit, if so pass it to the main queue else place it back into the DLS.
try {
| message = (TextMessage)objQueueReceiver.receive();
| strWIPId = message.getText();
| System.out.println("ResubmitFromDLQ :: resubmitStuckJobs :: strWIPId
="+ strWIPId);
| if(alMessages != null && alMessages.contains(strWIPId)) {
| objQueueSender.send(message);
| message.acknowledge();
| System.out.println("ResubmitFromDLQ :: resubmitStuckJobs :: SENT
...strWIPId :: "+strWIPId);
|
| } else {
| System.out.println("ResubmitFromDLQ :: resubmitStuckJobs :: Time ::
"+message.getJMSTimestamp());
| message.setJMSTimestamp(message.getJMSTimestamp());
| objBackQueueSender.send(message);
| message.acknowledge();
| System.out.println("ResubmitFromDLQ :: resubmitStuckJobs :: SENT to
DLQ...strWIPId :: "+strWIPId);
| }
Any suggestions and leads will be really helpful
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3898212#3898212
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3898212
---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user