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 » IBM MQ Java / JMS » JavaScript or JMS interface to Websphere MQ HttpBridge

Post new topic  Reply to topic
 JavaScript or JMS interface to Websphere MQ HttpBridge « View previous topic :: View next topic » 
Author Message
belchman
PostPosted: Thu Sep 26, 2013 6:45 am    Post subject: JavaScript or JMS interface to Websphere MQ HttpBridge Reply with quote

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
View user's profile Send private message
andrikaa
PostPosted: Wed Feb 26, 2014 9:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Thu Feb 27, 2014 2:59 am    Post subject: Reply with quote

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
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 » IBM MQ Java / JMS » JavaScript or JMS interface to Websphere MQ HttpBridge
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.