Java - Report from MQ - Websphere

This is a discussion on Java - Report from MQ - Websphere ; The code below works well for putting messages into MQ. The load balancing works perfect. I tried to obtain the report but no report is generated. How do I solve the problem?. Did I miss something?. Java code qMgr = ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: Java - Report from MQ

  1. Java - Report from MQ

    The code below works well for putting messages into MQ. The load balancing works perfect. I tried to obtain the report but no report is generated. How do I solve the problem?. Did I miss something?.


    Java code

    qMgr = new MQQueueManager(qManager);
    int openOptions = MQC.MQOO_OUTPUT ;
    MQQueue MQ1_RQSTIN = qMgr.accessQueue("QM1.RQSTIN",openOptions);
    MQMessage hello_world = new MQMessage();
    hello_world.putApplicationName = "src_mqsample.txt";
    hello_world.report = MQC.MQRO_COA ;
    hello_world.replyToQueueName = "QM1.REPLY";

    File file = new File("C:\\Documents and Settings\\My Documents\\JCreator LE\\MyProjects\\MQSample\\src_mqsample.txt");
    StringBuffer contents = new StringBuffer();
    BufferedReader reader = null;
    reader = new BufferedReader(new FileReader(file));
    String text = null;


    while((text = reader.readLine())!= null)
    {
    contents.append(text).append(System.getProperty("line.separator"));
    }

    hello_world.writeObject(contents);
    MQPutMessageOptions pmo = new MQPutMessageOptions();
    MQ1_RQSTIN.put(hello_world,pmo);


    MQ Script


    QM1

    DEFINE QLOCAL(DEAD.QUEUE)

    DEFINE QREMOTE(QM1.RQSTIN) RNAME(QM1.RQSTIN) RQMNAME(QM2) XMITQ(QM2.XMIT) PUT(ENABLED)

    DEFINE QLOCAL(QM2.XMIT) USAGE(XMITQ) TRIGGER TRIGDATA(QM1.QM2.DF) TRIGTYPE(FIRST)

    DEFINE CHANNEL(QM1.QM2.DF) CHLTYPE(SDR) TRPTYPE(TCP) XMITQ(QM2.XMIT) CONNAME('localhost(1415)')

    DEFINE CHANNEL(QM2.QM1.DF) CHLTYPE(RCVR) TRPTYPE(TCP)

    DEFINE QLOCAL(QM1.REPLY) PUT(ENABLED) GET(ENABLED)

    runmqlsr -m QM1 -t tcp -p 1420


    QM2

    DEFINE QLOCAL(DEAD.QUEUE)

    DEFINE QREMOTE(QM1.RQSTIN) RNAME(QM1.RQSTIN) RQMNAME(ANY.QMGR) XMITQ(Q3.XMIT) PUT(ENABLED)

    DEFINE QLOCAL(QM3.XMIT) USAGE(XMITQ) TRIGGER TRIGDATA(QM2.QM3.DF) TRIGTYPE(FIRST)

    DEFINE CHANNEL(QM2.QM3.DF) CHLTYPE(SDR) TRPTYPE(TCP) XMITQ(QM3.XMIT) CONNAME('localhost(1416)')

    DEFINE CHANNEL(QM1.QM2.DF) CHLTYPE(RCVR) TRPTYPE(TCP)

    DEFINE QREMOTE(QM1.REPLY) RQMNAME(QM1) RNAME('') XMITQ(QM1.XMIT)

    DEFINE QLOCAL(QM1.XMIT) USAGE(XMITQ) TRIGGER TRIGDATA(QM2.QM1.DF) TRIGTYPE(FIRST)

    DEFINE CHANNEL(QM2.QM1.DF) CHLTYPE(SDR) TRPTYPE(TCP) XMITQ(QM1.XMIT) CONNAME('localhost(1420)')

    runmqlsr -m QM2 -t tcp -p 1415

    runmqlsr -m QM2 -t tcp -p 1419


    QM3

    DEFINE QLOCAL(DEAD.QUEUE)

    DEFINE QREMOTE(ANY.QMGR)

    DEFINE CHANNEL(QM2.QM3.DF) CHLTYPE(RCVR) TRPTYPE(TCP)

    DEFINE CHANNEL(QM3.QM4.DF) CHLTYPE(CLUSSDR) CONNAME('localhost(1417)') CLUSTER(CLUS2)

    DEFINE CHANNEL(QM3.QM3.DF) CHLTYPE(CLUSRCVR) CONNAME('localhost(1416)') CLUSTER(CLUS2)

    DEFINE QREMOTE(QM1.REPLY) RQMNAME(QM1) RNAME(MQ1.REPLY) XMITQ(QM2.XMIT)

    DEFINE QLOCAL(QM2.XMITQ) USAGE(XMITQ) TRIGGER TRIGDATA(QM1.QM2.DF) TRIGTYPE(FIRST)

    DEFINE CHANNEL(QM1.QM2.DF) CHLTYPE(SDR) TRPTYPE(TCP) XMITQ(QM2.XMITQ) CONNAME('localhost(1419)')

    runmqlsr -m QM3 -t tcp -p 1416


    QM4

    ALTER QMGR REPOS(CLUS2)

    DEFINE QLOCAL(DEAD.QUEUE)

    DEFINE CHANNEL(QM3.QM4.DF) CHLTYPE(CLUSRCVR) TRPTYPE(TCP) CONNAME('localhost(1417)') CLUSTER(CLUS2)

    DEFINE CHANNEL(QM4.QM5.DF) CHLTYPE(CLUSSDR) CONNAME('localhost(1418)') CLUSTER(CLUS2)

    DEFINE QLOCAL(QM1.RQSTIN) CLUSTER(CLUS2)

    runmqlsr -m QM4 -t tcp -p 1417


    QM5

    ALTER QMGR REPOS(CLUS2)

    DEFINE QLOCAL(DEAD.QUEUE)

    DEFINE CHANNEL(QM4.QM5.DF) CHLTYPE(CLUSRCVR) TRPTYPE(TCP) CONNAME('localhost(1418)') CLUSTER(CLUS2)

    DEFINE CHANNEL(QM3.QM4.DF) CHLTYPE(CLUSSDR) CONNAME('localhost(1417)') CLUSTER(CLUS2)

    DEFINE QLOCAL(QM1.RQSTIN) CLUSTER(CLUS2)

    runmqlsr -m QM5 -t tcp -p 1418


    Your help is kindly appreciated.

    Thank You.

  2. Re: Java - Report from MQ

    I did modification on MQ script but still no report is generated.


    _*MQ Script*_

    _QM1_

    DEFINE QLOCAL(DEAD.QUEUE)

    DEFINE QREMOTE(QM1.RQSTIN) RNAME(QM1.RQSTIN) RQMNAME(QM2) XMITQ(QM2.XMIT) PUT(ENABLED)

    DEFINE QLOCAL(QM2.XMIT) USAGE(XMITQ) TRIGGER TRIGDATA(QM1.QM2.DF) TRIGTYPE(FIRST)

    DEFINE CHANNEL(QM1.QM2.DF) CHLTYPE(SDR) TRPTYPE(TCP) XMITQ(QM2.XMIT) CONNAME('localhost(1415)')

    DEFINE CHANNEL(QM2.QM1.DF) CHLTYPE(RCVR) TRPTYPE(TCP)

    DEFINE QLOCAL(QM1.REPLY)

    runmqlsr -m QM1 -t tcp -p 1420


    _QM2_

    DEFINE QLOCAL(DEAD.QUEUE)

    DEFINE QREMOTE(QM1.RQSTIN) RNAME(QM1.RQSTIN) RQMNAME(ANY.QMGR) XMITQ(Q3.XMIT) PUT(ENABLED)

    DEFINE QLOCAL(QM3.XMIT) USAGE(XMITQ) TRIGGER TRIGDATA(QM2.QM3.DF) TRIGTYPE(FIRST)

    DEFINE CHANNEL(QM2.QM3.DF) CHLTYPE(SDR) TRPTYPE(TCP) XMITQ(QM3.XMIT) CONNAME('localhost(1416)')

    DEFINE CHANNEL(QM1.QM2.DF) CHLTYPE(RCVR) TRPTYPE(TCP)

    DEFINE QREMOTE(QM1.REPLY) RNAME(QM1.REPLY) RQMNAME(QM1) XMITQ(QM1.XMIT)

    DEFINE QLOCAL(QM1.XMIT) USAGE(XMITQ) TRIGGER TRIGDATA(QM2.QM1.DF) TRIGTYPE(FIRST)

    DEFINE CHANNEL(QM2.QM1.DF) CHLTYPE(SDR) TRPTYPE(TCP) XMIQ(QM1.XMIT) CONNAME('localhost(1420)')

    DEFINE CHANNEL(QM3.QM2.DF) CHLTYPE(RCVR) TRPTYPE(TCP)

    runmqlsr -m QM2 -t tcp -p 1415

    runmqlsr -m QM2 -t tcp -p 1419


    _QM3_

    DEFINE QLOCAL(DEAD.QUEUE)

    DEFINE QREMOTE(ANY.QMGR)

    DEFINE CHANNEL(QM2.QM3.DF) CHLTYPE(RCVR) TRPTYPE(TCP)

    DEFINE CHANNEL(QM3.QM4.DF) CHLTYPE(CLUSSDR) CONNAME('localhost(1417)') CLUSTER(CLUS2)

    DEFINE CHANNEL(QM3.QM3.DF) CHLTYPE(CLUSRCVR) CONNAME('localhost(1416)') CLUSTER(CLUS2)

    DEFINE QREMOTE(QM1.REPLY) RNAME(QM1.REPLY) RQMNAME(QM2) XMITQ(QM2.XMIT) CLUSTER(CLUS2)

    DEFINE QLOCAL(QM2.XMIT) USAGE(XMITQ) TRIGGER TRIGDATA(QM3.QM2.DF) TRIGTYPE(FIRST)

    DEFINE CHANNEL(QM3.QM2.DF) CHLTYPE(SDR) TRPTYPE(TCP) XMITQ(QM2.XMIT) CONNAME('localhost(1419)')

    runmqlsr -m QM3 -t tcp -p 1416


    _QM4_

    ALTER QMGR REPOS(CLUS2)

    DEFINE QLOCAL(DEAD.QUEUE)

    DEFINE CHANNEL(QM3.QM4.DF) CHLTYPE(CLUSRCVR) TRPTYPE(TCP) CONNAME('localhost(1417)') CLUSTER(CLUS2)

    DEFINE CHANNEL(QM4.QM5.DF) CHLTYPE(CLUSSDR) CONNAME('localhost(1418)') CLUSTER(CLUS2)

    DEFINE QLOCAL(QM1.RQSTIN) CLUSTER(CLUS2)

    DEFINE QREMOTE(QM1.REPLY) RNAME(QM1.REPLY) RQMNAME(QM3) XMITQ('') CLUSTER(CLUS2)

    runmqlsr -m QM4 -t tcp -p 1417


    _QM5_

    ALTER QMGR REPOS(CLUS2)

    DEFINE QLOCAL(DEAD.QUEUE)

    DEFINE CHANNEL(QM4.QM5.DF) CHLTYPE(CLUSRCVR) TRPTYPE(TCP) CONNAME('localhost(1418)') CLUSTER(CLUS2)

    DEFINE CHANNEL(QM3.QM4.DF) CHLTYPE(CLUSSDR) CONNAME('localhost(1417)') CLUSTER(CLUS2)

    DEFINE QLOCAL(QM1.RQSTIN) CLUSTER(CLUS2)

    DEFINE QREMOTE(QM1.REPLY) RNAME(QM1.REPLY) RQMNAME(QM3) XMITQ('') CLUSTER(CLUS2)

    runmqlsr -m QM5 -t tcp -p 1418

  3. Re: Java - Report from MQ

    Is there anything that I need to set on QM4 and QM5 to get the queue manager to generate report and send it over to QM1?.

  4. Re: Java - Report from MQ

    Or do I just get the application receiving the messages in QM4 and QM5 to send a reply message to QM1?.

  5. Re: Java - Report from MQ

    I check the DLQ and no message in there.

  6. Re: Java - Report from MQ

    I think I miss replyToQueueManager

  7. Re: Java - Report from MQ

    Still the COA is not arriving to QM1 QM1.REPLY. It looks like MQ has no idea on how to send the message because ANY.QMGR does not exist.

  8. Re: Java - Report from MQ

    I tried to runmqsc on QM4 and QM5:

    DEFINE QALIAS(ANY.QMGR) TARGQ(QM1.REPLY) CLUSTER(CLUS2)

    In you java code:

    hello_world.replyToQueueName = "ANY.QMGR";
    hello_world.replyToQueueManagerName = "QM3"

    However it is unsuccessful. How do I solve the problem?.

+ Reply to Thread