|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
AMQ9208_MQJMS PTP Program Remotely running via SVRCONN chl |
« View previous topic :: View next topic » |
Author |
Message
|
ralierd |
Posted: Tue Mar 13, 2007 2:20 pm Post subject: AMQ9208_MQJMS PTP Program Remotely running via SVRCONN chl |
|
|
Newbie
Joined: 06 Apr 2006 Posts: 3
|
Greetings everyone,
I am attempting to run an MQJMS PTP program remotely from where the MQServer/QMGR is running. I am able to write messages to the queue but cannot retrieve/GET the messages on time.
I am generating the following MQ message:
03/13/07 17:44:22 - Process(10133.7) User(mqm) Program(amqrmppa)
AMQ9208: Error on receive from host xxxxxxx (yy.y.yy.yyy).
EXPLANATION:
An error occurred receiving data from xxxxxxx (yy.y.yy.yyy) over TCP/IP.
This may be due to a communications failure.
ACTION:
The return code from the TCP/IP (read) call was 131 (X'83'). Record these
values and tell the systems administrator.
We are running MQ V6.0.2.0 on a Solaris 8 machine.
Has anyone encountered this issue or could possibly shed some light on the root cause of the issue?
Thank you in advance,
RD _________________ RD |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Mar 13, 2007 7:01 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Can you post some of the code?
Have you made sure that the firewall is open in bi-directional mode for the MQ Listener Port ?
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
ralierd |
Posted: Wed Mar 21, 2007 5:45 am Post subject: |
|
|
Newbie
Joined: 06 Apr 2006 Posts: 3
|
According to the Network team, there are no firewall rules restricting traffic on this thread.
I have pasted the source code of the PTP program (which is a variation of IBM's sample program):
import javax.jms.*;
import java.io.*;
import java.util.*;
// Imports for JNDI
import javax.naming.*;
import javax.naming.directory.*;
import javax.naming.Context;
// The following import would not normally be required in a JMS application,
// but is included here to allow us to bypass the JNDI lookup stage
import com.ibm.mq.jms.JMSC;
import com.ibm.mq.jms.MQQueue;
import com.ibm.mq.jms.MQQueueConnectionFactory;
// Import required for program tracing
import com.ibm.mq.jms.services.ConfigEnvironment;
public class RDJMSQueue01
{
public static void main( String[] args )
{
boolean enableTrace = false;
MQQueueConnectionFactory factory = null;
QueueConnection connection = null;
QueueSession session = null;
QueueSender queueSender = null;
QueueReceiver queueReceiver = null;
enableTrace = true;
if( enableTrace )
ConfigEnvironment.start();
try
{
factory = new MQQueueConnectionFactory();
factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
factory.setQueueManager("QM1");
factory.setHostName("server1.com");
factory.setChannel("JMS.ITS.SVRCONN");
factory.setPort(1414);
connection = factory.createQueueConnection();
boolean transacted = false;
session = connection.createQueueSession(transacted, Session.AUTO_ACKNOWLEDGE);
MQQueue q = new MQQueue();
q.setBaseQueueManagerName("QM1");
q.setBaseQueueName("JMS.ITS.PUBQ");
q.setPersistence(DeliveryMode.PERSISTENT);
q.setPriority(5);
queueSender = session.createSender(q);
// queueReceiver = session.createReceiver(q);
TextMessage outMessage = session.createTextMessage();
String outString = "MARCH 13, 2007 - TAKE 1";
outMessage.setText(outString);
queueSender.send(outMessage);
//*
//The following will attempt to retrieve the message sent:
//*
queueReceiver = session.createReceiver(q);
Message inMessage = queueReceiver.receive(1000);
if( inMessage == null )
{
System.out.println( "The attempt to read the message back again failed, apparently because it wasn't there");
throw new JMSException("Failed to get message back again");
}
// ...otherwise display the message
System.out.println( "\n" + "Got message"+": "+inMessage);
// Check that the message received (a) is of the correct type,
// and (b) contains the same text as the one sent, reporting the
// result of these two checks
if( inMessage instanceof TextMessage )
{
// Extract the message content with getText()
String replyString = ((TextMessage) inMessage).getText();
if( replyString.equals(outString) )
{
System.out.println("Reply string equals original string");
} else
{
// If they differ, print them both out
System.out.println("Error! Reply string differs from original string");
System.out.println("Original string = '" + outString + "'");
System.out.println("Reply string = '" + replyString + "'");
}
}
System.exit(0);
}
catch (Throwable je)
{
je.printStackTrace();
System.exit(1);
}
finally
{
try
{
//Closing QueueReceiver
System.out.println("Closing QueueReceiver");
queueReceiver.close();
// Closing QueueSender
System.out.println("Closing QueueSender");
queueSender.close();
//Closing QueueSesssion.
System.out.println("Closing Session");
session.close();
session = null;
//Closing QueueConnection.
System.out.println("Closing Connection");
connection.close();
connection = null;
}
catch(Throwable t)
{
}
}
}
}
 |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Mar 21, 2007 12:13 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You are using the standard on a client connection
Quote: |
connection = factory.createQueueConnection(); |
On a client connection you should be using:
Code: |
connection = factory.createQueueConnection(username, passwd); |
Enjoy  _________________ MQ & Broker admin |
|
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
|
|
|
|