Author |
Message
|
Kareem_khan |
Posted: Fri Jul 09, 2004 7:14 am Post subject: WSAD5.1 MQSeries5.3 BACK OUT QUEUE(DEAD LETTER QUEUE) |
|
|
Apprentice
Joined: 09 Jul 2004 Posts: 27 Location: Jackson,MS
|
Hi,
I have configured IBM Websphere for backout Queues in order to put
unprocessed(bad) messages in to Queue strange thing is that even good messages which are processed by Message Driven bean also going to
back out queue I couldnot figure out possible reasons.Here is the test code for MQ Series program as well onMessage method of Message driven bean.It is simpel program trying to put 20 Good and 20 bad messages into the queue and I am expecting 20 bad messages to go into
Back out queue but what I see is that good messages which are prining as Sccuss also going into backout queue.Our intention is to ensure only bad(unprocessed) messages to be their in back out queue so that we figure out way's to process those messages the messages that we are sending in our project are XML documents which need to be processed.
if for some reason could not should go in to back out queue so that we figureout some way to process those bad XML messages.
Here is the example program that I am trying to test so that messages behave accoridingly.
MQSeries client program. that puts 20 bad and 20 good messages
package mdb.test;
import java.util.Hashtable;
import com.ibm.mq.MQC;
import com.ibm.mq.MQEnvironment;
import com.ibm.mq.MQException;
import com.ibm.mq.MQGetMessageOptions;
import com.ibm.mq.MQMessage;
import com.ibm.mq.MQPutMessageOptions;
import com.ibm.mq.MQQueue;
import com.ibm.mq.MQQueueManager;
public class TestClient {
public static void main(String[] args) throws Exception
{
putGoodMessages();
putDeadMssage();
}
static void putDeadMssage()throws Exception
{
MQEnvironment.hostname = "100.12.26.56";
MQEnvironment.port =1432;
MQEnvironment.channel = "SP_CHANNEL";
MQQueueManager qMgr = new MQQueueManager("sat.sp.queue.mgr");
MQQueue postingQueue = qMgr.accessQueue("SP_POSTING",MQC.MQOO_OUTPUT);
for(int i=0;i<20;i++)
{
MQMessage message = new MQMessage();
message.format = MQC.MQFMT_STRING;
MQPutMessageOptions options = new MQPutMessageOptions();
options.options = MQC.MQPMO_NO_SYNCPOINT;
message.writeString("Dead Messages Wrong Data");
postingQueue.put(message, options);
}
postingQueue.close();
qMgr.disconnect();
}
static void putGoodMessages()throws Exception
{
MQEnvironment.hostname = "100.12.26.56";
MQEnvironment.port =1432;
MQEnvironment.channel = "SP_CHANNEL";
MQQueueManager qMgr = new MQQueueManager("sat.sp.queue.mgr");
MQQueue postingQueue = qMgr.accessQueue("SP_POSTING",MQC.MQOO_OUTPUT);
for(int j=0;j<20;j++)
{
MQMessage message = new MQMessage();
message.format = MQC.MQFMT_STRING;
MQPutMessageOptions options = new MQPutMessageOptions();
options.options = MQC.MQPMO_NO_SYNCPOINT;
message.writeString("Hello"+j);
postingQueue.put(message, options);
}
postingQueue.close();
qMgr.disconnect();
}
}
onMessageMethod of Message driven bean. print "Sccuss" if message is good else message should go to Back out Queue
public void onMessage(javax.jms.Message msg) {
try
{
TextMessage txtMsg =(TextMessage)msg;
String messageStr= txtMsg.getText();
if(messageStr.length() > 10)
{
throw new Exception("Wrong Data");
}
else
{
System.out.println("Sccuss :"+messageStr);
}
}
catch(JMSException jmsEx){getMessageDrivenContext().setRollbackOnly();}
catch(RuntimeException runEx){getMessageDrivenContext().setRollbackOnly();}
catch(Exception ex){getMessageDrivenContext().setRollbackOnly();}
} |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jul 09, 2004 2:43 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Check your messages before retrieving them from the queue:
Put messages to the queue while WAS is not running.
Check the messages on the queue with a utility and verify that the message is what you expect.
Start WAS and process messages. Check that result match.
Remember you are checking length of message. Spaces count too.
You might want to add a line to your message bean:
Code: |
String messageStr= txtMsg.getText();
messageStr = messageStr.trim();
if(messageStr.length() > 10)
|
Have fun.
F.J. |
|
Back to top |
|
 |
Kareem_khan |
Posted: Mon Jul 12, 2004 7:01 am Post subject: Backout Queue problem still persists |
|
|
Apprentice
Joined: 09 Jul 2004 Posts: 27 Location: Jackson,MS
|
I did tried by Triming the string length.The Whole problem is
The message Gets processed because it being good message and I see the processed good messages in dead letter queue(Backout queue) also.
This example I wrote for demonstrating secanario.In our project we
are using message driven bean to post documents and process them.
we are getting this kind of problem where document gets processed and see them in Backout queue also.I am could not understand possible reason Please need help.
Thank you |
|
Back to top |
|
 |
Kareem_khan |
Posted: Mon Jul 12, 2004 1:01 pm Post subject: AMQ9208: Error on receive from host 10.3.32.45. |
|
|
Apprentice
Joined: 09 Jul 2004 Posts: 27 Location: Jackson,MS
|
Hi,
I am getting no problem in WSAD side and their are no exceptions
looks their everything run smoothly in WSAD so I turn out towards
MQSeries Error logs It seems their are problems with MQSeries
I don't know possible reason that caused errors in MQSeries.
Here is the error log message that causing good messages to go in to
Dead letter queue.
07/12/04 15:34:34
AMQ9208: Error on receive from host xx.x.xx.xx.
EXPLANATION:
An error occurred receiving data from xx.x.xx.xx over TCP/IP. This may be due to a communications failure.
ACTION:
The return code from the TCP/IP (read) call was 73 (X'49'). Record these values and tell the systems administrator.
----- amqccita.c : 2758
Please any Idea what exactly it might be.
Thanks in Advance. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jul 12, 2004 3:49 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
It might well be that your jndi set up for was is wrong.
Can you post it ?
F.J. |
|
Back to top |
|
 |
Kareem_khan |
Posted: Tue Jul 13, 2004 7:18 am Post subject: WSAD Properties of Que Manager and Que |
|
|
Apprentice
Joined: 09 Jul 2004 Posts: 27 Location: Jackson,MS
|
Hi,
Thank you for looking at the problem.
Here is the WSAD Server JMS Server properties for
listenerport,Queue Manager and Queue respectively
ADMIN CONSOLE.
-Servers
Application Servers MessageListener Service Listener Ports
Name : serverPort
initial State : Started
description : problems with dead letter queues
Connection factory Jndiname: jms/ServerMgr
Destinatino JNDI name : jms/ServerQueue
Maximum sessions : 50
Maximum retries : 4
maximum messages : 50
-Resources
Websphere MQJMS Privider Websphere MQ Que Connection Factory
Server Manager(manager Name that I gave)
Name :Server Manager
JNDI Name :jms/ServerMgr
Description :
Category :
Component-managed Authentication Alias:
Container-managed Authentication Alias:
Mapping-Configuration Alias :DefaultPrincipalMapping
Queue Manager :sat.ap.queue.mgr
Host x.xx.xx.xx
port :1432
Channel :AP_CHANNEL
TransportType :Client
Model Queue Definition :
Client ID :
CCSID :
Message Retention :check box true(Enable message retention)
XA Enable :check box true(Enable XA)
Websphere MQ Queue Destinations
Server Queue
Scope :cells:localhost:nodes:localhost
Name :Server Queue
JNDI Name :jms/ServerQueue
Description :
Category :
Persistence :Application Defined
Priority :Application Defined
Specified Priority :Application Defined
Expiry :0
Specified Expiry :0 milliseconds
Base Queue Name :AP_POSTING
Base Queue Manager :sat.ap.queue.mgr
CCSID :
Native Encoding :false check box(Use native encoding)
Integer Encoding :Normal
Decimal Encoding :Normal
Floating Point Encoding :IEEENormal
Target Client :MQ
Queue Manager Host x.xx.xx.xx
Queue Manager Port :1432
Server Connection Channel Name:AP_CHANNEL
user Id :
password : |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jul 13, 2004 11:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Looks like your JNDI setup is ok.
Get your network admin involved.
You might simply have tcp/ip problems...
or WSAD problems ...
Remember that the MDB works through at tcp/ip port ...

Last edited by fjb_saper on Wed Jul 14, 2004 8:13 am; edited 1 time in total |
|
Back to top |
|
 |
Kareem_khan |
Posted: Wed Jul 14, 2004 6:25 am Post subject: Problem even though both WSAD MQServer on same system |
|
|
Apprentice
Joined: 09 Jul 2004 Posts: 27 Location: Jackson,MS
|
Hi,
I have both WSAD, MQSeries5.3 on the same system my
Queus are running locally still I am getting this problem will it be due to network problem?. Well I did ask Net work people to chek
if at all their are any problems with the Network. sent the above mentioned TCP/IP errors that are occuring at MQ Series Server.
Waiting for Network peoples response.
Thank you so much for reply. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jul 14, 2004 8:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
To better analyse you should be more specific in your exception handling for your onMessage method
specially on the jms side:
Code: |
}catch (JMSException jmse){
System.err.println(jmse.getMessage());
Exception ex = jmse.getLinkedException();
if (ex!=null) System.err.println(ex.getMessage());
getMessageDrivenContext().setRollbackOnly();} |
It might just be that your message is not understood as a text message
You do not intercept the class cast exception either ....
All your intercepts directly roll back the transaction. After the agreed upon number of roll backs the messages go to the backout queue.
Enjoy
[/b] |
|
Back to top |
|
 |
Kareem_khan |
Posted: Wed Jul 14, 2004 1:18 pm Post subject: |
|
|
Apprentice
Joined: 09 Jul 2004 Posts: 27 Location: Jackson,MS
|
Hi I tried puting printStackTrace() for all of catch block of Exception including catch block of Runtime exception.Problem that I don't understand is Good messages which never thrown exception going to Back out queue It does't seems to me that ever good messages that are appering in Back out queue thown the exception.
I am still waiting for networking people to trace out some problem if at all their is in net work
Thank you by the by |
|
Back to top |
|
 |
|