|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
JavaScript or JMS interface to Websphere MQ HttpBridge |
« View previous topic :: View next topic » |
Author |
Message
|
belchman |
Posted: Thu Sep 26, 2013 6:45 am Post subject: JavaScript or JMS interface to Websphere MQ HttpBridge |
|
|
Partisan
Joined: 31 Mar 2006 Posts: 386 Location: Ohio, USA
|
I am trying to 'get a clue' with regards to doing a PUT and a destructive GET to MQHttpBridge from a CGI script.
I have searched to the end of the Internet for a barebones snippet of code that shows me how to do what I need to do.
I currently have 3 things that basically work with some issues. I have a CGI/PERL script and 2 java classes.
The java classes are compliations of butchered versions of HTTPPOST.java and HTTPDELETE.java renamed as MQPingPut.java and MQPingGet.java.
In the CGI, I call the java classes using system('my java call').
I am hoping to replace that "system('my java call')" with javascript or ajax to make this easier to use.
What I have works, but it not robust in RE to error handling and thus has to much likelihood of a false positive.
My objecting is to have a process by which in one click on ouor Wiki, production support can prove that MQ is not the cause of the problem. When the link is followed, the CGI runs and puts a ping message on a queue and that message is routed around a certain MQ circuit until it winds up on the response queue (same queue manager as request queue).
Does anyone have any code they don't mind sharing that I can put in my CGI script for the HttpBridge interface?
My java currently has something like this, but I do not know how to get it where it is useful in javascript. The java below actually works. I just can't get a "success indicator" back to the CGI.
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
String thisCorrelID = "hello11";
String thisExpiry = "30000"; // ten seconds
connection.setRequestProperty("content-type", "text/plain");
connection.setRequestProperty("x-msg-priority", "LOW");
connection.setRequestProperty("x-msg-expiry", thisExpiry);
connection.setRequestProperty("x-msg-correlID", thisCorrelID);
connection.setDoOutput(true);
OutputStream outputStream = connection.getOutputStream();
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(
outputStream));
writer.write(message + CRLF + CRLF);
writer.flush();
connection.connect(); _________________ Make three correct guesses consecutively and you will establish a reputation as an expert. ~ Laurence J. Peter |
|
Back to top |
|
 |
andrikaa |
Posted: Wed Feb 26, 2014 9:52 pm Post subject: |
|
|
Newbie
Joined: 12 Feb 2014 Posts: 1
|
Difference between Java and Javascript? Are there any real key differences between the 2, I know Javascript has become a mainsteam thing, But should I really uptake Java if i'm gonna be learning Javascipt? Is Java a prerequist for Javascript?
_______________________
video library ~ commercial video ~ supplies garden
Last edited by andrikaa on Fri Feb 28, 2014 1:52 am; edited 1 time in total |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Feb 27, 2014 2:59 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
JavaScript and Java are entirely different things, with no prerequisites from one to the other. |
|
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
|
|
|
|