ibm mq - How to get information about message retrieved from queue -


i'm new in ibm mq. using following code can put message in queue , message.

public void queueput() {         queue = queuemanager.accessqueue("q1", mqc.mqoo_output + mqc.mqoo_fail_if_quiescing);         mqmessage message = new mqmessage();         message.writestring("stackoverflow");          mqputmessageoptions putmessageoptions = new mqputmessageoptions();          putmessageoptions.options += mqc.mqpmo_async_response;          queue.put(message, putmessageoptions); }   public void queueget() {          queue = queuemanager.accessqueue("q2", mqc.mqoo_input_as_q_def + mqc.mqoo_fail_if_quiescing);         mqmessage gotmessage = new mqmessage();          queue.get(gotmessage);          string str = message.readstring(gotmessage.messagelength); } 

you can see i'm writing message 'q1' , reading 'q2' since q1 alias queue

now, thing want information message got in queueget function. want know gotmessage comes 'q1' if i'm reading in 'q2'.

the basequeuename point real queue alias queue refers to. in case queue being opened queues real queue itself. hence basequeuename not point anything.

it's not right use mqc.mqca_base_q_name while opening queue it's not queue open option. queue open options begin mqoo_.

you can use pcf classes query alias queue , find it's base queue name. @ moment unaware if there way find alias(es) of base queue.

edit:

alias queue not queue local queue. name suggests, it's name local queue. not hold messages. when application opens alias queue, queue manager resolves actual queue.

aliasing helps

1) hide queue/topic pointing to. way applications unaffected change queue/topic.

2) provide different level of authority applications. 1 application can put not while application can not put same queue.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -