--
You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
As per this group chain i have tried the same steps which are mentioned above.
I am able to create the MQ Jar and I am able to create the imposter also.
But the issue i am facing is, i cant see any consumers on the Queue and no messages are getting consumed from the queue [Rather those are getting piled up]
So could you please analyse the jar files which i have created and help me to understand where am i going wrong.
So it will be very helpful, if you can share the jar file which you have created and working fine
Kindly let me know, if you need any other details on the same.
Regards
Reshma
####PFB the java source code###
package com.sv.test.kewill;
import java.io.InputStream;
import java.util.Hashtable;
import java.util.Properties;
import com.ibm.mq.MQException;
import com.ibm.mq.MQMessage;
import com.ibm.mq.MQPutMessageOptions;
import com.ibm.mq.MQQueue;
import com.ibm.mq.MQQueueManager;
import com.ibm.mq.constants.MQConstants;
public class Mountebanktest {
String hostName=null; // host name
String channel=null; // server connection channel
String port=null; // port number on which the QMGR is running
// FileInputStream fileInputStream = new FileInputStream(fileName);
String qmgrName=null;
// define the name of the QueueManager
private static final String qManager = "test";
// and define the name of the Queue
private static final String qName = "REQ";
/**
* Main entry point
*
* @param args - command line arguments (ignored)
* @throws MQException
* @throws InterruptedException
*/
public static void main(String[] args) throws MQException, InterruptedException{
mqOpen("Test1");
}
public static void mqOpen(String output) throws MQException, InterruptedException {
//String hostName=null; // host name
//String channel=null; // server connection channel
// String port=null;
//String qName=null;// port number on which the QMGR is running
//public String qmgrName; // queue manager name
//public String qName; // queue name
Hashtable<String, Object> props = new Hashtable<String, Object>();
props.put(MQConstants.CHANNEL_PROPERTY, "test");
// props.put(MQConstants.CHANNEL_PROPERTY, channel);
props.put(MQConstants.PORT_PROPERTY, 1414);
//props.put(MQConstants.PORT_PROPERTY, port);
props.put(MQConstants.HOST_NAME_PROPERTY, "test");
// props.put(MQConstants.HOST_NAME_PROPERTY,hostName);
MQQueueManager qMgr=null;
try {
// Create a connection to the QueueManager
System.out.println("Connecting to queue manager: " + qManager);
qMgr = new MQQueueManager(qManager,props);
System.out.println("mgr"+qMgr.toString());
// Set up the options on the queue we wish to open
int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF | MQConstants.MQOO_OUTPUT;
// Now specify the queue that we wish to open and the open options
System.out.println("Accessing queue: " + qName);
MQQueue queue = qMgr.accessQueue(qName, openOptions);
// Define a simple WebSphere MQ Message ...
MQMessage msg = new MQMessage();
// ... and write some text in UTF8 format
//msg.writeUTF("Hello, World!");
// msg.writeBytes("Hello, World!");
// msg.writeString("Hello, World!");
msg.writeString(output);
// Specify the default put message options
MQPutMessageOptions pmo = new MQPutMessageOptions();
// Put the message to the queue
System.out.println("Sending a message...");
queue.put(msg, pmo);
// Thread.sleep(8000);
// Now get the message back again. First define a WebSphere MQ
// message
// to receive the data
// MQMessage rcvMessage = new MQMessage();
// Specify default get message options
//MQGetMessageOptions gmo = new MQGetMessageOptions();
// Get the message off the queue.
// System.out.println("...and getting the message back again");
//queue.get(rcvMessage, gmo);
// And display the message text...
// String msgText = rcvMessage.readUTF();
// System.out.println("The message is: " + msgText);
// Close the queue
System.out.println("Closing the queue");
queue.close();
}
catch (MQException ex) {
System.out.println("A WebSphere MQ Error occured : Completion Code " + ex.completionCode
+ " Reason Code " + ex.reasonCode);
ex.printStackTrace();
for (Throwable t = ex.getCause(); t != null; t = t.getCause()) {
System.out.println("... Caused by ");
t.printStackTrace();
}
}
catch (java.io.IOException ex) {
System.out.println("An IOException occured whilst writing to the message buffer: " + ex);
}
finally{
// Disconnect from the QueueManager
System.out.println("Disconnecting from the Queue Manager");
qMgr.close();
qMgr.disconnect();
System.out.println("Done!");
}
return;
}
}
> > > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
>
> >
>
> > >
>
> >
>
> > > For more options, visit https://groups.google.com/d/optout.
>
> >
>
> >
>
> >
>
> > --
>
> >
>
> > You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
>
> >
>
> > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
> To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
> > > > > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > > For more options, visit https://groups.google.com/d/optout.
> >
> > >
> >
> > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > --
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
> >
> > >
> >
> > > For more options, visit https://groups.google.com/d/optout.
> >
> >
> >
> > --
> >
> > You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
> >
> > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
> > > > > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-disc...@googlegroups.com.
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > > For more options, visit https://groups.google.com/d/optout.
> >
> > >
> >
> > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > --
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-disc...@googlegroups.com.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-disc...@googlegroups.com.
> >
> > >
> >
> > > For more options, visit https://groups.google.com/d/optout.
> >
> >
> >
> > --
> >
> > You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
> >
> > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-disc...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mountebank-discuss/cd623f14-d274-4352-aae4-6e5718c9e519o%40googlegroups.com.
> > > > > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > > For more options, visit https://groups.google.com/d/optout.
> >
> > >
> >
> > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > --
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
> >
> > >
> >
> > > For more options, visit https://groups.google.com/d/optout.
> >
> >
> >
> > --
> >
> > You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
> >
> > To unsubscribe from this group and stop receiving emails from it, send an email to <a
Hi Brandon
Our requirement is to virtualize active MQ.
We have below code to connect, subscribe, publish message to active MQ. Can you please tell me how to integrate with our protocol.json file.
Also note that, we are starting activeMq client in command prompt (D:\............\apache-activemq-5.15.13-bin\apache-activemq-5.15.13\bin\win64\activemq)
var stompit = require('stompit');
// Configure connection management
var servers = [
{
host: 'localhost',
port: 61613,
connectHeaders:{
'host': 'localhost',
'login': 'admin',
'passcode': 'password',
'heart-beat': '100,100'
}
}
];
var reconnectOptions = {
maxReconnects: 1
};
var connections = new stompit.ConnectFailover(servers, reconnectOptions);
// Log connection events
connections.on('connecting', function(connector) {
var address = connector.serverProperties.remoteAddress.transportPath;
console.log('Connecting to ' + address);
});
connections.on('error', function(error) {
var connectArgs = error.connectArgs;
var address = connectArgs.host + ':' + connectArgs.port;
console.log('Connection error to ' + address + ': ' + error.message);
});
// Create channel, subscribe to a queue, and consume one message
var channelFactory = new stompit.ChannelFactory(connections);
channelFactory.channel(function(error, channel) {
if (error) {
console.log('channel factory error: ' + error.message);
return;
}
var headers = {
'destination': '/queue/testactivemq',
'ack': 'client-individual'
};
channel.subscribe(headers, function(error, message, subscription){
if (error) {
console.log('subscribe error: ' + error.message);
return;
}
message.readString('utf8', function(error, string) {
if (error) {
console.log('read message error: ' + error.message);
return;
}
console.log('receive message: ' + string);
channel.ack(message);
// We only want to consume one message so we unsubscribe now
subscription.unsubscribe();
});
});
});
Thanks
Palak
-------------------------------------------------------------------------------------------------
> > > > > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > > For more options, visit https://groups.google.com/d/optout.
> >
> > >
> >
> > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > --
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
> >
> > >
> >
> > > For more options, visit https://groups.google.com/d/optout.
> >
> >
> >
> > --
> >
> > You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
> >
> > To unsubscribe from this group and stop receiving emails from it, send an email to <a
To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mountebank-discuss/760fe5c0-3cb8-43a4-86bc-9e457108419en%40googlegroups.com.
Hi Brandon,The body that I am posting to http://localhost:2525/imposters/4548/_requests looks like {"Article":{"articleIds":["10005242"],"query":"ABC"}}.My imposter is{"port": 4548,"protocol": "IBMMQ","name": "test","defaultResponse": {"statusCode": 405,"body": "Invalid Input","headers": {"Content-Type": "text/plain","Response": "From Default"}},"stubs": [{"responses": [{"is": {"statusCode": 200,"headers": {"Content-Type": "application/json"}},"_behaviors": {"shellTransform": ["node OMS002b.js"]}}]}]}Thanks and Regards,Ramya.
To view this discussion on the web visit https://groups.google.com/d/msgid/mountebank-discuss/67971f0f-6ac7-4f2f-bbdc-d75570697883n%40googlegroups.com.
Hi,We are using keystore and other files in kdb format for SSL configuration in the code, but we are getting some key repository error. Could you help us with this?
To view this discussion on the web visit https://groups.google.com/d/msgid/mountebank-discuss/1ed23a05-5dcc-450f-b1ca-33c23a302140n%40googlegroups.com.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-disc...@googlegroups.com.
>
> >
>
> > >
>
> >
>
> > > For more options, visit https://groups.google.com/d/optout.
>
> >
>
> >
>
> >
>
> > --
>
> >
>
> > You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
>
> >
>
> > To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-disc...@googlegroups.com.
> To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-disc...@googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-disc...@googlegroups.com.