|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
A ROW var(holding JSON) conversion to blob |
« View previous topic :: View next topic » |
Author |
Message
|
anurag.munjal |
Posted: Sun Aug 20, 2017 12:23 am Post subject: A ROW var(holding JSON) conversion to blob |
|
|
 Voyager
Joined: 08 Apr 2012 Posts: 97
|
Hello Champions,
Requirement is below:
I have a JSON array coming at MQ input node which is holding a json array.
This input json message, that holds a json array, is storing key value pairs.
now amongst this key value pair, one of the value is a json in itself.
We need to out this inner json message to outputroot as blob which eventually is to be published to IOT.
i have been able to store the inner json in a ROW type variable as i couldnt store in any other type of variables.
So, the question is, how do we convert a ROW type variable into blob??????
Am not exactly sure about ASBITSTREAM, never used it. am going through it, but some guidance here would be really helpful! thanks.
as per below message, basically i want to send as blob the value of Itsvalue per below message.
Thanks
Sample Message:
{
"xxx": "sas",
"aa": "abc",
"attributes": [{
"My_name": "SomeAtt",
"Itsvalue ": {
"aabbcc": {
"hhddll": "contact admin",
"contact admin": "http.smaldj.kjasd.asd.nc"
}
}
}]
} _________________ - Anurag
------------------------
Be Simple, Be Happy |
|
Back to top |
|
 |
anurag.munjal |
Posted: Sun Aug 20, 2017 1:13 am Post subject: 80% solved |
|
|
 Voyager
Joined: 08 Apr 2012 Posts: 97
|
So,
i tried this:
DECLARE tmp BLOB ASBITSTREAM(EnvironmentRef OPTIONS options CCSID 1208);
the tmp is able to store in blob my required Json, but its storing the variable above the required json too.
as per the sample message if you refer to that, tmp is storing the below in blob (pasting it post conversion:
"My_name": "SomeAtt",
"Itsvalue ": {
"aabbcc": {
"hhddll": "contact admin",
"contact admin": "http.smaldj.kjasd.asd.nc"
}
}
Wheras, what i need is this:
{
"aabbcc": {
"hhddll": "contact admin",
"contact admin": "http.smaldj.kjasd.asd.nc"
}
}
Here, _________________ - Anurag
------------------------
Be Simple, Be Happy |
|
Back to top |
|
 |
anurag.munjal |
Posted: Sun Aug 20, 2017 1:16 am Post subject: |
|
|
 Voyager
Joined: 08 Apr 2012 Posts: 97
|
forgot to mention, here EnvironmentRef is a reference to Itsvalue per sample message[url][/url] _________________ - Anurag
------------------------
Be Simple, Be Happy |
|
Back to top |
|
 |
timber |
Posted: Sun Aug 20, 2017 12:27 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Please add a Trace node after the MQInput node and set the Pattern property to ${Root}. In the trace file you will get a detailed listing of the message tree including the data type of every node.
Once you have that, it should be obvious how to solve your problem. If not, feel free to post again (and quote the Trace node output, obviously!). |
|
Back to top |
|
 |
anurag.munjal |
Posted: Sun Aug 20, 2017 6:31 pm Post subject: |
|
|
 Voyager
Joined: 08 Apr 2012 Posts: 97
|
Thanks for your response!
I fixed the issue by using adbitstream function using folder option!
Thankss _________________ - Anurag
------------------------
Be Simple, Be Happy |
|
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
|
|
|
|