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 IndexGeneral IBM MQ SupportDifferent Format of Message Samples

Post new topicReply to topic
Different Format of Message Samples View previous topic :: View next topic
Author Message
EricL
PostPosted: Wed Jul 18, 2018 7:44 am Post subject: Different Format of Message Samples Reply with quote

Voyager

Joined: 10 Oct 2014
Posts: 78

Hi,

I'm doing some MQ/IIB tests need to test different types format of messages, like messages in xml format, MQSTR format etc, I'm actually not familiar with message format types, I just need some different types of messages for testing purpose, can please let me know from where can I get different format types of messages (samples) for testing.

Thanks
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Jul 18, 2018 8:03 am Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 8112
Location: US: west coast, almost. Otherwise, enroute.

At a minimum, the message payload MQPUT to a queue consists of an MQMD (Message Descriptor) header and your application data - from 0 bytes to 100MB per physical message.

Your application data can consist of anything you want - text, binaries, xml, audio, video, whatever you want. The format field in the MQMD is used to tell the consuming application what kind of data is contained in the application data portion of the message. NOTE: If your app sets this field value to MQFMT_STRING, it does NOT make the application data string.
_________________
I would tell you a UDP joke, but you might not get it.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 18, 2018 8:32 am Post subject: Re: Different Format of Message Samples Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25118
Location: Ohio, USA

EricL wrote:
I'm doing some MQ/IIB tests need to test different types format of messages, like messages in xml format, MQSTR format etc, I'm actually not familiar with message format types, I just need some different types of messages for testing purpose, can please let me know from where can I get different format types of messages (samples) for testing.


The Format field is used by the application that puts the message to describe the message, and by the putting application to work out what it's going to do with it. You've presumably found the list of possible values here and it's clear a lot of these are really only generated and used by MQ itself. You shouldn't see a message with a format of MQFMT_ADMIN in an application queue that IIB is processing.

If you want samples, then you can generate them with a test harness but a application (and IIB is an application in this context) will only see a small subset: MQFMT_NONE, MQFMT_STRING & one of the MQFMT_RF_HEADER. Even this last is semi-obsolete with the rise of message properties.

Note that IIB will always show an RFH2 header in the message tree even if the original message didn't have one but has properties instead - that's just how IIB represents properties internally.

The only format which makes a difference to MQ is the MQFMT_STRING. If the message is described such (and to underline the point made by my worthy associate, that's just the description given by the putting application, not a validated format nor a cast), and the getting application requests a convert, and the code pages of the queue manager hosting the local queue & the CCSID in the message MQMD differ, and the hosting OS has a translation table for those 2 code pages, then MQ will convert the message from the message CCSID into the hosting CCSID before presenting it to the application.

If the message a) wasn't really a string b) wasn't completely a string but had binary data embedded in it (e.g. a data record) c) wasn't really in the code page shown in the MQMD then the application will receive various qualities of contact admin.

Most application messages are sent as MQFMT_STRING (because they are) or MQFMT_NONE (because the putting application wants to prevent auto conversion)

Hope this helps.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 18, 2018 8:35 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25118
Location: Ohio, USA

In fairness. posting a link to a list of the format types and a description of what they mean rather than just a list might have been more useful on my part.

Warning: It says in that link that you can create user defined formats, to call a user defined data conversion exits. DON'T.

You may be tempted to think "oh, so I can define MQFMT_XML for my XML messages" and clearly describe them. This means you need to write an exit that can be called, and all the usual warnings about MQ exits apply. XML is string.

If you have a more complex message type, define it as MQFMT_NONE and tell IIB to use a DFDL model on it. DFDL has far more functional richness as well as more tooling and error handling than any possible MQ exit.

Application code, as I've said, use STRING and NONE by and large.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
EricL
PostPosted: Wed Jul 18, 2018 11:46 am Post subject: Reply with quote

Voyager

Joined: 10 Oct 2014
Posts: 78

Thanks for your quick response....

Think I didn't make myself understood, what I need is just some message sample files in different format, say file sample1.xml contains message in xml format, sample2.txt contains message in MQSTR format....so when I make test on a workflow, I can simply use different format message files as an input......

As said, I'm not familiar with message format, not sure how to make message files in different format, just post my request here see if I can get some samples files or get guidance to find related info...

Thanks again....
Back to top
View user's profile Send private message
EricL
PostPosted: Wed Jul 18, 2018 11:53 am Post subject: Reply with quote

Voyager

Joined: 10 Oct 2014
Posts: 78

For example:

There is a request to test message in MQSTR format:

MQHeader: Format = MQSTR CCSID = 1252
MQData: <Test>test<Part>PART</Part></Test>

How can I form a file with message in MQSTR format so that I can use it for workflow test?
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 18, 2018 12:01 pm Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25118
Location: Ohio, USA

EricL wrote:
say file sample1.xml contains message in xml format, sample2.txt contains message in MQSTR format....so when I make test on a workflow, I can simply use different format message files as an input......


Ok, as I attempted to explain above, from an MQ standpoint both of your samples are MQSTR. They're both pure text with no embedded binary data.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 18, 2018 12:04 pm Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25118
Location: Ohio, USA

EricL wrote:
How can I form a file with message in MQSTR format so that I can use it for workflow test?


Use Notepad. Seriously.

If you have a better XML document editor (e.g. XMLSpy) use that.

In terms of how you get the contents of said file into a message with MQSTR in the MQMD RFHUtil (or the client version RFHUtilc) is my tool of choice.

Other tools are available and may suit your needs better.

If you're using IIB, the facilities in the Toolkit may be all you need.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Wed Jul 18, 2018 4:02 pm Post subject: Re: Different Format of Message Samples Reply with quote

Padawan

Joined: 25 Mar 2003
Posts: 1857
Location: Melbourne, Australia

EricL wrote:
Hi,
I'm doing some MQ/IIB tests need to test different types format of messages, like messages in xml format, MQSTR format etc, I'm actually not familiar with message format types, I just need some different types of messages for testing purpose, can please let me know from where can I get different format types of messages (samples) for testing.
Thanks

IIB flows will usually be dealing with text (aka MQSTR) format MQ messages. MQ messages may also contain RFH folders / properties / name value pairs. Its quite easy to dummy up some text data (XML, whatever) and put it in a message using MQ Explorer, RFHUTIL, amqsput.

There may be an external app that is generating the MQ message to be processed by IIB. What is their requirement? How are they going to generate it?
_________________
Glenn
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexGeneral IBM MQ SupportDifferent Format of Message Samples
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.