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 » Set CorrelId in the GDM

Post new topic  Reply to topic
 Set CorrelId in the GDM « View previous topic :: View next topic » 
Author Message
JosephGramig
PostPosted: Thu May 21, 2015 7:25 am    Post subject: Set CorrelId in the GDM Reply with quote

Grand Master

Joined: 09 Feb 2006
Posts: 1244
Location: Gold Coast of Florida, USA

OK, I can see that the MsgId and CorrelId are hexBinary in the GDM.

I need to set the CorrelId to a specific value from a string.
Tried xs:hexBinary('Some Crazy Stuff the App does'), but I get "The operand cannot be cast to type 'xs:hexBinary'".

Some assistance would be nice.

I'm actually composing the CorrelId from data in a MQ request (before the request is made).

BTW in XPath, are strings enclosed in single '' or double "" quotes? I've been using double and that works but maybe it one is more right...
Back to top
View user's profile Send private message AIM Address
fjb_saper
PostPosted: Thu May 21, 2015 7:46 am    Post subject: Re: Set CorrelId in the GDM Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

JosephGramig wrote:
OK, I can see that the MsgId and CorrelId are hexBinary in the GDM.

I need to set the CorrelId to a specific value from a string.
Tried xs:hexBinary('Some Crazy Stuff the App does'), but I get "The operand cannot be cast to type 'xs:hexBinary'".

Some assistance would be nice.

I'm actually composing the CorrelId from data in a MQ request (before the request is made).

BTW in XPath, are strings enclosed in single '' or double "" quotes? I've been using double and that works but maybe it one is more right...

Have you tried setting this crazy correlID in JMS?.
There are specific rules in JMS when using RFH2 folder.
The correlID as string goes to some folder in the RFH2 (full length). The correlId gets cut at 24 bytes and those get set in the correlID field of the MQMD. This is what gives the correlID in form ID:xxxxxxxx hex value which is a String (JMS). (51 long).

When checking for the correlID, set the correlID in String form (JMS) and then immediately retrieve it from the message and you might get the ID:xxxx form (padded with zeros to the right) or the full String if it was over 24 bytes long...

You could try playing with it (both fields are in RFHUtil)...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Thu May 21, 2015 7:57 am    Post subject: Re: Set CorrelId in the GDM Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fjb_saper wrote:
Have you tried setting this crazy correlID in JMS?.

I'm not sure that's strictly relevant to using the GDM to set a CorrelId field in OutputRoot.MQMD.CorrelID...
Back to top
View user's profile Send private message
JosephGramig
PostPosted: Thu May 21, 2015 9:08 am    Post subject: Reply with quote

Grand Master

Joined: 09 Feb 2006
Posts: 1244
Location: Gold Coast of Florida, USA

Martin B. has confirmed there is no handy XPath function to convert characters (string) to hex encoded.

He indicated you could if you stand on your head and fart the Star Spangled Banner...

I'm now going to backup the truck and write a custom Java method to do this.

Funny how the GDM requires a great deal more effort to do a complex msg xform than just plain old code...
Back to top
View user's profile Send private message AIM Address
fjb_saper
PostPosted: Thu May 21, 2015 9:31 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

What happens if you just / only set it in the JMS folder of the RFH2 header (as string).
Does it get correctly translated to the MQMD on the Written destination?

Instead of looking for a transform function did you try to cast the string as BLOB?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Thu May 21, 2015 2:45 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Martin B. has confirmed there is no handy XPath function to convert characters (string) to hex encoded.

He indicated you could if you stand on your head and fart the Star Spangled Banner...
[quote]That workaround only applies if you're using v9.0.0.3. In earlier versions, you have to sneeze the Post Horn Gallop.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri May 22, 2015 4:38 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

kimbert wrote:
Quote:
Martin B. has confirmed there is no handy XPath function to convert characters (string) to hex encoded.

He indicated you could if you stand on your head and fart the Star Spangled Banner...
That workaround only applies if you're using v9.0.0.3. In earlier versions, you have to sneeze the Post Horn Gallop.


I've had reasonably good luck accomplishing complicated GDM maps while burping Jerusalem.
Back to top
View user's profile Send private message
JosephGramig
PostPosted: Fri May 22, 2015 7:08 am    Post subject: Reply with quote

Grand Master

Joined: 09 Feb 2006
Posts: 1244
Location: Gold Coast of Florida, USA

As it turns out, my colleague Ron M. (not his real name) has a flow actually doing this in the Graphical Data Mapper (GDM) for an MQ message (having nothing what so ever to do with excrementally (since this tool won't let me say what I really mean ) JMS).

On the GDM when you draw a line from the source to the target you get the igmo 'Move' operation. If you click the almost imperseptable tiny blue upside down triangle, you can change that operation to many different things and one of them is 'Convert'. Since "Ron's" flow has been demonstrated to work (although I didn't see it so I don't believe it) I have to believe it work (although I will prove it).
Back to top
View user's profile Send private message AIM Address
fjb_saper
PostPosted: Fri May 22, 2015 7:41 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

So did you try convert -> cast-> xs:binary ?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
martinb
PostPosted: Mon May 25, 2015 1:54 am    Post subject: Reply with quote

Master

Joined: 09 Nov 2006
Posts: 210
Location: UK

Hi

The xs:<type> functions are type casts - so the source operand must be in a format that can be cast to the <type>.

Similarly the built in "Convert" transform is providing a type case between it's source and target element's schema types.

In this case the input is a plain text string, so we can't just cast it, it would first need to be formatted into a string of hex codes representing the original text.

Transforming a string of text characters to a string containing their hex codes can be indeed done XPath. However if Xpath is not your natural instrument of choice to play a fine tune, then the Mapper does allows you to call out to Java or ESQL.

Here's the XPath I've used to format and then cast a text string input, in this case from Mapping input variable "$a" to a hxeBinary

Code:

xs:hexBinary(string-join(
for $code in string-to-codepoints($a)
return (
    substring('0123456789ABCDEF', ($code idiv 16) + 1, 1),
    substring('0123456789ABCDEF', ($code mod 16) + 1, 1)
            ),''))
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon May 25, 2015 4:22 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Not quite trivial as you said. An ESQL cast from chat to BLOB is much easier.
_________________
MQ & Broker admin
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 » Set CorrelId in the GDM
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.