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 » Taking JSON file, modifying its content, sending it to queue

Post new topic  Reply to topic
 Taking JSON file, modifying its content, sending it to queue « View previous topic :: View next topic » 
Author Message
Ksawery
PostPosted: Wed Oct 12, 2022 12:22 am    Post subject: Taking JSON file, modifying its content, sending it to queue Reply with quote

Newbie

Joined: 12 Oct 2022
Posts: 2

I have a JSON file locally with three items. In the Compute node, I want to retrieve data from this file and propagate it separately to a queue. Item 1 by terminal out, item 2 by terminal out1 and item 3 by terminal out2. This turns a file that contained three items into three separate files, each with only one item.

For input, I use the FileInput node. In the Compute node, I retrieve this data and flip it into a queue. Here a note: I flip the whole thing into the queue.

This is what my request is about: please give me hints on how I can point or refer to the content in the JSON file so that I can retrieve and split it into three files?

Thanks a lot!

ACE 12
Back to top
View user's profile Send private message
timber
PostPosted: Wed Oct 12, 2022 12:25 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Please can you give a few details about what you have tried already, and what you already understand. Without that information it is very difficult to help, because we don't know where to start with the explanations.
Back to top
View user's profile Send private message
Ksawery
PostPosted: Fri Oct 14, 2022 12:33 am    Post subject: Reply with quote

Newbie

Joined: 12 Oct 2022
Posts: 2

Hi, thanks. I'm usiing FileInput node to pick a .json file from my computer. This file contains an object 'Customers' with three positions starting with ID 1, then ID 2 and ID 3. I've got also a local queue manager.

In the middle I'm using Compute node and so far I was able to parse the json file from my local folder to my local queue by using:
Code:
SET OutputRoot.JSON.Data = InputRoot.JSON.Data;


I've also tried this:
Code:
SET OutputRoot.JSON.Data.Customers.ID = InputRoot.JSON.Data.Customers.ID;


But by doing this "something" goes on from folder to queue, but I don't see nothing but just 0 into it.

Now, the thing is I need to take the first customer, so ID 1 (with its relative name, username, address... and so on) and parse them to the queue propagating them to terminal out1. Then do the same with ID 2 and send them to terminal out2, and again the same with ID 3 to terminal out3.

What I don't know is how to "interact" (?) with these json data.

I think I can REFERENCE TO... something in my json file, but I can't figure out HOW to REFERENCE to something in a simple file in json format.

Thank you very much for your help!
Back to top
View user's profile Send private message
joebuckeye
PostPosted: Fri Oct 14, 2022 6:51 am    Post subject: Reply with quote

Partisan

Joined: 24 Aug 2007
Posts: 364
Location: Columbus, OH

Put a Trace node before your compute node to see the structure of your JSON message and how the broker sees it.

Put $Root in the Trace node for the desired output.

With the lack of details of your input message structure we cannot provide concrete help for you.
Back to top
View user's profile Send private message
timber
PostPosted: Fri Oct 14, 2022 7:43 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Please bear in mind that this forum is for answering specific technical questions. We are not a free development service, or a free online training service.

I can help with this part of your problem:
Quote:
I need to take the first customer, so ID 1 (with its relative name, username, address... and so on) and parse them to the queue propagating them to terminal out1. Then do the same with ID 2 and send them to terminal out2, and again the same with ID 3 to terminal out3.

The information in this topic should be enough to put you on the right track: https://www.ibm.com/docs/en/integration-bus/9.0.0?topic=content-generating-multiple-output-messages
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 » Taking JSON file, modifying its content, sending it to queue
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.