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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ImqQueue::put() and remote queue definitions

Status
Not open for further replies.

skarab

Programmer
Jul 5, 2001
1
US
I'm trying to send a message to a remote queue manager's local queue via a remote queue definition on my local queue manager. I have configured two channels that communicate correctly, a transmission queue that works well also, and a remote queue definition that specifies the remote queue manager's local queue. I used the API Exerciser to test the connections and was able to send a message using MPUT1. MPUT fails with the error 2045.

I'm trying in a very simple C++ application to send a STRING message to the remote queue via the remote queue definition.

ex code:

ImqQueueManager manager ;
ImqChannel * pchannel = 0 ;
ImqQueue *pqueue = new ImqQueue;
ImqMessage *pmsg = new ImqMessage;

// pchannel is all set up as is manager

manager.setChannelReference(pchannel);
manager.setName("LOCAL_QUEUE_MANAGER_NAME");
manager.connect(); // successful

pqueue->setConnectionReference(manager);
pqueue->setName("REMOTE_QUEUE_DEFINITION_NAME");
pqueue->setOpenOptions(MQOO_OUTPUT | MQOO_INPUT_SHARED |
MQOO_INQUIRE);

pmsg->setFormat(MQFMT_STRING);
pmsg->useFullBuffer("Hello world!", 12);

pqueue->put(*pmsg);

printf("%ld",pqueue->reasonCode());

It always prints out the failed reason code and the remote queue manager doesn't get it.

I could very well not understand the concept of a remote queue definition, so feel free to jump on me about that.

Any help or advice is appreciated. (BTW, I don't have access to the remote machine).
 
You can't open a remote queue for Input. This is not a problem since you can't GET messages from a Remote queue anyway.

Cheers,
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top