|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Not recieving full message while connecting MQ with WAS |
« View previous topic :: View next topic » |
Author |
Message
|
usman.usmani@gmail.com |
Posted: Mon Aug 28, 2006 6:22 am Post subject: Not recieving full message while connecting MQ with WAS |
|
|
Newbie
Joined: 20 Jun 2006 Posts: 8
|
Hi,
I am trying to connect Websphere MQ with WAS ND 6.0 using foriegn bus and MQLink inside was and remote queue and channel link on MQ. I can send message to the destination(Queue) inside was but the problem is i cannot read full message body.
Can any one tell me how to sort this out or a work arround.
Regards. _________________ Usmani |
|
Back to top |
|
 |
vennela |
Posted: Mon Aug 28, 2006 8:48 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
How are you reading the message? |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Aug 28, 2006 3:24 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
already previously discussed. Do a search on the forum... _________________ MQ & Broker admin |
|
Back to top |
|
 |
usman.usmani@gmail.com |
Posted: Mon Aug 28, 2006 11:38 pm Post subject: |
|
|
Newbie
Joined: 20 Jun 2006 Posts: 8
|
I am creating a mediation handler on the destination that i want to recieve messages on and inside that mediation handler i am trying to reciece message. Below is the code that i used.
if you know the previous message please let me know i am trying to search but cannot find it.
public class RequestTransformationMediator implements MediationHandler{
public boolean handle(MessageContext msgCtx) throws MessageContextException {
//flag to determine weather to send message or not
boolean contMsgProcessing = true;
//type casted context
SIMessageContext _siMsgCtx = (SIMessageContext) msgCtx;
//the actual message that we recieved
SIMessage origionalMessage = _siMsgCtx.getSIMessage();
SIMessage transformedMessage = null;
//check what transformation is needed
if(SIApiConstants.JMS_FORMAT_TEXT.equalsIgnoreCase(origionalMessage.getFormat()))
{
try {
transformedMessage = performTextToObjectTransformation(origionalMessage);
} catch (IncompatibleMessageException e) {
e.printStackTrace();
}
}
if(SIApiConstants.JMS_FORMAT_BYTES.equalsIgnoreCase(origionalMessage.getFormat()))
{
try {
transformedMessage = performBytesToObjectTransformation(origionalMessage);
} catch (IncompatibleMessageException e) {
e.printStackTrace();
}
}
if(transformedMessage!=null)
origionalMessage = transformedMessage;
return contMsgProcessing;
}
private SIMessage performBytesToObjectTransformation(SIMessage origionalMessage) throws IncompatibleMessageException {
DataGraph graph = null;
try {
graph = origionalMessage.getDataGraph();
} catch (SIDataGraphSchemaNotFoundException e) {
// log.error(MessageFormat.format("Cannot extract DataGraph from message. Exception : {0}" ,new Object[]{e}));
throw new IncompatibleMessageException("Cannot extract Data Graph from message",e);
} catch (SIMessageException e) {
// log.error(MessageFormat.format("Cannot extract DataGraph from message. Exception : {0}" ,new Object[]{e}));
throw new IncompatibleMessageException("Cannot extract Data Graph from the message" , e);
}
DataObject dataObject = graph.getRootObject();
if(dataObject == null)
{
// log.error(MessageFormat.format("Cannot extract DataGraph from message. Exception : {0}" ,new Object[]{e}));
throw new IncompatibleMessageException("Cannot extract Data Object from the message", new NullPointerException("DataObject is null"));
}
byte [] _orig_payload = dataObject.getBytes("data/value");
System.out.println("---TOtal bytes recieved --" + _orig_payload.length);
String payload = new String(_orig_payload);
System.out.println(MessageFormat.format("The pay Load is {0}",new Object[]{payload}));
if(payload==null || payload.trim().equals(""))
{
// log.error(MessageFormat.format("Cannot extract DataGraph from message. Exception : {0}" ,new Object[]{e}));
throw new IncompatibleMessageException("The payload is empty or null", new NullPointerException("the payload is empty or null"));
}
SIMessage _newMessage = null;
_newMessage = performStringToObjectTransformation(payload,origionalMessage);
return _newMessage;
}
private SIMessage performTextToObjectTransformation(SIMessage origionalMessage) throws IncompatibleMessageException {
DataGraph graph = null;
try {
graph = origionalMessage.getDataGraph();
} catch (SIDataGraphSchemaNotFoundException e) {
// log.error(MessageFormat.format("Cannot extract DataGraph from message. Exception : {0}" ,new Object[]{e}));
throw new IncompatibleMessageException("Cannot extract Data Graph from message",e);
} catch (SIMessageException e) {
// log.error(MessageFormat.format("Cannot extract DataGraph from message. Exception : {0}" ,new Object[]{e}));
throw new IncompatibleMessageException("Cannot extract Data Graph from the message" , e);
}
DataObject dataObject = graph.getRootObject();
if(dataObject == null)
{
// log.error(MessageFormat.format("Cannot extract DataGraph from message. Exception : {0}" ,new Object[]{e}));
throw new IncompatibleMessageException("Cannot extract Data Object from the message", new NullPointerException("DataObject is null"));
}
String payload = dataObject.getString("data/value");
System.out.println(MessageFormat.format("The pay Load is {0}",new Object[]{payload}));
if(payload==null || payload.trim().equals(""))
{
// log.error(MessageFormat.format("Cannot extract DataGraph from message. Exception : {0}" ,new Object[]{e}));
throw new IncompatibleMessageException("The payload is empty or null", new NullPointerException("the payload is empty or null"));
}
SIMessage _newMessage = null;
_newMessage = performStringToObjectTransformation(payload,origionalMessage);
return _newMessage;
}
}
Thanks and regards _________________ Usmani |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Aug 29, 2006 2:37 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Sorry can't find it right now... Did you check for any APAR's? _________________ MQ & Broker admin |
|
Back to top |
|
 |
usman.usmani@gmail.com |
Posted: Tue Aug 29, 2006 5:19 am Post subject: |
|
|
Newbie
Joined: 20 Jun 2006 Posts: 8
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|