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 » GlobalCache Walkthrough

Post new topic  Reply to topic
 GlobalCache Walkthrough « View previous topic :: View next topic » 
Author Message
lancelotlinc
PostPosted: Wed Apr 24, 2013 7:07 am    Post subject: GlobalCache Walkthrough Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

MB 8.0.0.2

I'm following along on this presentation:

http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/index.jsp?topic=/com.ibm.iea.wmb_v7/wmb/8.0.0.1/OperationsAndManagement/WMB8001_GlobalCache_SingleBroker/wmb8001_globalcache_singlebroker_viewlet_swf.html

where the MsgId is used to store the MQMD in the GlobalCache.

The example shows this code:

Code:
String msgId = message.getRootElement().getFirstElementByPath("/MQMD/MsgId").getValueAsString();


However, the function getFirstElelmentByPath returns null, and the example code in my workspace fails at that point.

Did something change for 8.0.0.2 on the getFirstElementByPath? else, is there an updated walkthrough that I can view?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Apr 24, 2013 7:51 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

so is "message" an MbMessage object?

Does getRootElement() return a valid MbElement object?

Is the message being sent from MQ, and does the esql path InputRoot.MQMD.MsgId valid, and have a value? I mean, if you use a trace node to see the tree...
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Apr 24, 2013 8:39 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Yes, getRootElement returns

MbElement( type: 1000000 name: Root )
handle 184931056
isAttached true
isReadOnly false


Code:
2013-04-24 10:22:59.257109

=======================
Root:

( ['MQROOT' : 0xafab920]
  (0x01000000:Name  ):Properties = ( ['MQPROPERTYPARSER' : 0xafd9a80]
    (0x03000000:NameValue):MessageSet             = '' (CHARACTER)
    (0x03000000:NameValue):MessageType            = '' (CHARACTER)
    (0x03000000:NameValue):MessageFormat          = '' (CHARACTER)
    (0x03000000:NameValue):Encoding               = 546 (INTEGER)
    (0x03000000:NameValue):CodedCharSetId         = 1208 (INTEGER)
    (0x03000000:NameValue):Transactional          = TRUE (BOOLEAN)
    (0x03000000:NameValue):Persistence            = FALSE (BOOLEAN)
    (0x03000000:NameValue):CreationTime           = GMTTIMESTAMP '2013-04-24 14:25:17.470' (GMTTIMESTAMP)
    (0x03000000:NameValue):ExpirationTime         = -1 (INTEGER)
    (0x03000000:NameValue):Priority               = 0 (INTEGER)
    (0x03000000:NameValue):ReplyIdentifier        = X'000000000000000000000000000000000000000000000000' (BLOB)
    (0x03000000:NameValue):ReplyProtocol          = 'MQ' (CHARACTER)
    (0x03000000:NameValue):Topic                  = NULL
    (0x03000000:NameValue):ContentType            = '' (CHARACTER)
    (0x03000000:NameValue):IdentitySourceType     = '' (CHARACTER)
    (0x03000000:NameValue):IdentitySourceToken    = '' (CHARACTER)
    (0x03000000:NameValue):IdentitySourcePassword = '' (CHARACTER)
    (0x03000000:NameValue):IdentitySourceIssuedBy = '' (CHARACTER)
    (0x03000000:NameValue):IdentityMappedType     = '' (CHARACTER)
    (0x03000000:NameValue):IdentityMappedToken    = '' (CHARACTER)
    (0x03000000:NameValue):IdentityMappedPassword = '' (CHARACTER)
    (0x03000000:NameValue):IdentityMappedIssuedBy = '' (CHARACTER)
  )
  (0x01000000:Name  ):MQMD       = ( ['MQHMD' : 0xaf6fd00]
    (0x03000000:NameValue):SourceQueue      = 'DQL.REQUEST' (CHARACTER)
    (0x03000000:NameValue):Transactional    = TRUE (BOOLEAN)
    (0x03000000:NameValue):Encoding         = 546 (INTEGER)
    (0x03000000:NameValue):CodedCharSetId   = 1208 (INTEGER)
    (0x03000000:NameValue):Format           = 'MQHRF2  ' (CHARACTER)
    (0x03000000:NameValue):Version          = 2 (INTEGER)
    (0x03000000:NameValue):Report           = 0 (INTEGER)
    (0x03000000:NameValue):MsgType          = 8 (INTEGER)
    (0x03000000:NameValue):Expiry           = -1 (INTEGER)
    (0x03000000:NameValue):Feedback         = 0 (INTEGER)
    (0x03000000:NameValue):Priority         = 0 (INTEGER)
    (0x03000000:NameValue):Persistence      = 0 (INTEGER)
    (0x03000000:NameValue):MsgId            = X'414d51204d4238514d47522020202020bbd4775120001d8c' (BLOB)
    (0x03000000:NameValue):CorrelId         = X'000000000000000000000000000000000000000000000000' (BLOB)
    (0x03000000:NameValue):BackoutCount     = 0 (INTEGER)
    (0x03000000:NameValue):ReplyToQ         = '                                                ' (CHARACTER)
    (0x03000000:NameValue):ReplyToQMgr      = 'WMQRTPD1                                        ' (CHARACTER)
    (0x03000000:NameValue):UserIdentifier   = 'local_mqadmi' (CHARACTER)
    (0x03000000:NameValue):AccountingToken  = X'16010515000000ef9bc4fbf0b5674f07390083eb03000000000000000000000b' (BLOB)
    (0x03000000:NameValue):ApplIdentityData = '                                ' (CHARACTER)
    (0x03000000:NameValue):PutApplType      = 11 (INTEGER)
    (0x03000000:NameValue):PutApplName      = 'C:\apps\ibm\ih03\rfhutil.exe' (CHARACTER)
    (0x03000000:NameValue):PutDate          = DATE '2013-04-24' (DATE)
    (0x03000000:NameValue):PutTime          = GMTTIME '14:25:17.470' (GMTTIME)
    (0x03000000:NameValue):ApplOriginData   = '    ' (CHARACTER)
    (0x03000000:NameValue):GroupId          = X'000000000000000000000000000000000000000000000000' (BLOB)
    (0x03000000:NameValue):MsgSeqNumber     = 1 (INTEGER)
    (0x03000000:NameValue):Offset           = 0 (INTEGER)
    (0x03000000:NameValue):MsgFlags         = 0 (INTEGER)
    (0x03000000:NameValue):OriginalLength   = -1 (INTEGER)
  )
  (0x01000000:Name  ):MQRFH2     = ( ['MQHRF2' : 0xb0b1560]
    (0x03000000:NameValue):Version        = 2 (INTEGER)
    (0x03000000:NameValue):Format         = '        ' (CHARACTER)
    (0x03000000:NameValue):Encoding       = 546 (INTEGER)
    (0x03000000:NameValue):CodedCharSetId = 1208 (INTEGER)
    (0x03000000:NameValue):Flags          = 0 (INTEGER)
    (0x03000000:NameValue):NameValueCCSID = 1208 (INTEGER)
    (0x01000000:Name     ):usr            = (
      (0x01000000:Name):identifer = (
        (0x03000000:NameValue):dt = 'i4' (CHARACTER)
        (0x02000000:Value    ):   = '1' (CHARACTER)
      )
    )
  )
  (0x01000000:Folder):XMLNSC     = ( ['xmlnsc' : 0x1b346b0]
    (0x01000400:NamespaceDecl):XmlDeclaration = (
      (0x03000100:Attribute):Version    = '1.0' (CHARACTER)
      (0x03000100:Attribute):Encoding   = 'UTF-8' (CHARACTER)
      (0x03000100:Attribute):StandAlone = 'yes' (CHARACTER)
    )
    (0x01000000:Folder 

_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Apr 24, 2013 9:42 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

And you're sure getFirstElementByPath("/MQMD/MsgId") returns Null?

It's not the getValueAsString() that's returning null?
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Apr 24, 2013 9:48 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Good question, thanks for helping me through this. I had thought of that.

All these "fbp*" return null (rootElement is valid/not null):

Code:
      MbElement rootElement = inMessage.getRootElement();
      MbElement fbp = rootElement.getFirstElementByPath("/MQMD/MsgId");
      MbElement fbp1 = rootElement.getFirstElementByPath("MQMD/MsgId");
      MbElement fbp2 = rootElement.getFirstElementByPath("/Root/MQMD/MsgId");
      MbElement fbp3 = rootElement.getFirstElementByPath("/MQMD");
      MbElement fbp4 = rootElement.getFirstElementByPath("/MQRFH2");
      MbElement fbp5 = rootElement.getFirstElementByPath("MQMD");
      MbElement fbp6 = rootElement.getFirstElementByPath("MQRFH2");

_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Apr 24, 2013 9:52 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I didn't doubt you had thought of it... But it's easy to forget to check things.

Try using a path of "//MQMD/MsgId".
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Apr 24, 2013 10:10 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

//MQMD/MsgId produces "malformedPathException".
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Apr 24, 2013 10:23 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Back to top
View user's profile Send private message
Esa
PostPosted: Wed Apr 24, 2013 11:34 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

I have just recently implemented similar queries with V 8.0.0.2 without problems.

What about restarting your toolkit, cleaning the projects, recompiling and redeploying?

Obviously the message that is being processed is not the input message but something else, an uninitialized output message, LocalEnvironment etc.

Try something like this to find out where you are:

Code:
MbElement cursor = message.getRootElement().getFirstChild();
String firstElement = cursor.getName();
cursor = cursor.getNextSibling();
String secondElement = cursor.getName();



After you have solved this little problem it would be interesting to hear if you manage to access the global cache. I couldn't. It seems the eXtreme Scale java client jars and the server components in v 8.0.0.2 are in different version levels that are incompatible. Or there is something wrong with my environment.

You can always do this:
Code:
String key = "dummy";
String value = "another dummy";

<the global map stuff>.put(key, value);

just to find out if you are able to connect to the global cache and issue a put.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Apr 24, 2013 12:38 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Using your code, Esa, firstElement is successfully read as "Properties". Upon cursor.getNextSibling, cursor becomes null.

Something is wrong with the 8.0.0.2 tree-walk in Java. I'll file a PMR on it shortly.

This morning, I was successful in storing items in the cache. Something happened this afternoon, and when I try to getGlobalMap, the attempt times out because the client is not able to connect to the catalog server. I'll troubleshoot that later.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Thu Apr 25, 2013 2:17 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
firstElement is successfully read as "Properties". Upon cursor.getNextSibling, cursor becomes null.

Something is wrong with the 8.0.0.2 tree-walk in Java. I'll file a PMR on it shortly.
I agree that this looks very strange. The Trace node output clearly shows that the next sibling of 'Properties' is 'MQMD'.

I assume that the Trace node output is from a Trace node that is positioned *immediately* before the JavaCompute node? If not, that would be the next thing to try.

Before you open that PMR, please can you replace the JavaCompute node with a Compute node that does *exactly* the same job using ESQL reference variables. I still suspect ( and hope ) that there is a straightforward explanation for this.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Apr 25, 2013 3:02 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

kimbert wrote:
Quote:
firstElement is successfully read as "Properties". Upon cursor.getNextSibling, cursor becomes null.

Something is wrong with the 8.0.0.2 tree-walk in Java. I'll file a PMR on it shortly.
I agree that this looks very strange. The Trace node output clearly shows that the next sibling of 'Properties' is 'MQMD'.

I assume that the Trace node output is from a Trace node that is positioned *immediately* before the JavaCompute node? If not, that would be the next thing to try.

Before you open that PMR, please can you replace the JavaCompute node with a Compute node that does *exactly* the same job using ESQL reference variables. I still suspect ( and hope ) that there is a straightforward explanation for this.


I thought about this as I fell to sleep last night. You know, I do my best coding in my sleep. I had placed a Compute node just prior to the JCN and I'm sure I did not pass along the message. Thanks all for commenting.

Once I verify this is indeed the issue, the next step is to figure out why the GlobalMap is not connecting to the catalog server.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
McueMart
PostPosted: Thu Apr 25, 2013 3:24 am    Post subject: Reply with quote

Chevalier

Joined: 29 Nov 2011
Posts: 490
Location: UK...somewhere

Just tested and all is working the same in 8.0.0.2 as 8.0.0.1 thankfully!
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Apr 25, 2013 3:59 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

lancelotlinc wrote:
kimbert wrote:
Quote:
firstElement is successfully read as "Properties". Upon cursor.getNextSibling, cursor becomes null.

Something is wrong with the 8.0.0.2 tree-walk in Java. I'll file a PMR on it shortly.
I agree that this looks very strange. The Trace node output clearly shows that the next sibling of 'Properties' is 'MQMD'.

I assume that the Trace node output is from a Trace node that is positioned *immediately* before the JavaCompute node? If not, that would be the next thing to try.

Before you open that PMR, please can you replace the JavaCompute node with a Compute node that does *exactly* the same job using ESQL reference variables. I still suspect ( and hope ) that there is a straightforward explanation for this.


I thought about this as I fell to sleep last night. You know, I do my best coding in my sleep. I had placed a Compute node just prior to the JCN and I'm sure I did not pass along the message. Thanks all for commenting.

Once I verify this is indeed the issue, the next step is to figure out why the GlobalMap is not connecting to the catalog server.


Yeah, it's either that the compute node is not passing along the message, or that the MbMessage element you're starting with is pointing to a relatively empty OutputRoot rather than a relatively populated InputRoot...
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Apr 25, 2013 6:22 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Everything works now. Thanks for the input.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » GlobalCache Walkthrough
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.