Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MQSeries CICS/ESA Bridge Message Structure in Java

Status
Not open for further replies.

gbills

Programmer
Oct 25, 2000
1
US
Hey All,

I have been trying to code a Java servlet to access
3270 transactions via the MQSeries CICS/ESA Bridge.
However,according to the provided documentation this entails
three parts to the message: MQMD (message descriptor), MQCIH
(CICS bridge header), and BRMQ vectors (contain the required data
to run the application). The MQMD is provided as a Java class, however,
I have not found any documentation as to how the MQCIH or BRMQ is formatted in Java. If anyone could offer any assistance (examples, sample code, good
reference URL's) it would be greatly appreciated.

Thanks,

Graham P. Bartholomae
 
Graham,

Afraid I can't help with the CICS bridge - I definitely haven't seen a reference to it in any MQ-Java manual!

However, when I wanted to try the Publish/Subscribe function with a base Java program I found the same problem - namely that the control blocks and definitions hadn't been provided with Java for the PubSub structures. So I wrote them myself and built up the message data manually. Here is a fragment of my code:
...
// MQ Publish Subscribe constants - SHOULD be defined by IBM!!!
private static final String MQFMT_RF_HEADER = "MQHRF ";
private static final String MQRFH_STRUC_ID = "RFH ";
private static final String MQPS_COMMAND_B = " MQPSCommand ";
private static final String MQPS_PUBLISH = "Publish";
private static final String MQPS_PUBLICATION_OPTIONS_B = " MQPSPubOpts ";
...
message.format = MQFMT_RF_HEADER;

message.writeBytes(MQRFH_STRUC_ID); // StrucId
message.writeInt4(MQRFH_VERSION_1); // Version
message.writeInt4(0); // StrucLength
message.writeInt4(MQC.MQENC_NATIVE); // Encoding
message.writeInt4(MQC.MQCCSI_Q_MGR); // CodedCharSetId
...

It's not pretty but if you keep that bit of code separate, if/when IBM get round to adding the definitions properly you should be able to just drop them in.

Note the use of methods writeBytes(), writeInt4() and writeString() depending upon the data.

Hope this helps,
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top