ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Not recieving full message while connecting MQ with WAS

Post new topic  Reply to topic
 Not recieving full message while connecting MQ with WAS « View previous topic :: View next topic » 
Author Message
usman.usmani@gmail.com
PostPosted: Mon Aug 28, 2006 6:22 am    Post subject: Not recieving full message while connecting MQ with WAS Reply with quote

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
View user's profile Send private message
vennela
PostPosted: Mon Aug 28, 2006 8:48 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

How are you reading the message?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fjb_saper
PostPosted: Mon Aug 28, 2006 3:24 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
usman.usmani@gmail.com
PostPosted: Mon Aug 28, 2006 11:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Aug 29, 2006 2:37 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
usman.usmani@gmail.com
PostPosted: Tue Aug 29, 2006 5:19 am    Post subject: Reply with quote

Newbie

Joined: 20 Jun 2006
Posts: 8

Yes I found the messages. It is

http://www.mqseries.net/phpBB2/viewtopic.php?t=30869&highlight=mq+integration

and i resolved the issue as well. I was using the WAS test enviroment and by installing the latest patch for WAS test environment 6.205 it was resolved. Thanks

Regards
_________________
Usmani
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Not recieving full message while connecting MQ with WAS
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.