Hi,
First, if you are designing a complex solution that involves MQ, you
should either (1) get some MQ training ASAP or (2) hire a good MQ
consultant (i.e. T.Rob Wyatt).
Secondly, there are 2 types of Unit of Work (UOW) that can be done
with MQ: single phase and 2 phase. To do 2 phase UOW, you will need
an external resource manager and this is typically done when an
application wants to get a message from MQ and then update a
database. In this case, the database is the external resource
manager. You can do single phase UOW with MQ and Azure Service Bus
but your application will be the 'master of its domain' (so to speak).
i.e. Single phase UOW is done using the MQGMO_SYNCPOINT option
MQQueueManager _qMgr = null;
MQQueue _queue = null;
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.Options = MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQGMO_NO_WAIT +
MQC.MQGMO_SYNCPOINT;
try
{
_qMgr = new MQQueueManager(queueManagerName, properties);
_queue = _qMgr.AccessQueue(queueName, MQC.MQOO_INPUT_AS_Q_DEF +
MQC.MQOO_FAIL_IF_QUIESCING);
MQMessage mqMsg = new MQMessage();
mqQueue.Get(mqMsg, gmo);
/*
* Now do your stuff with Azure Service Bus
* when done, commit the MQ message.
*/
_qMgr.Commit();
}
finally
{
/* Something bad happened, backout the get. */
if (_qMgr != null)
_qMgr.Backout();
if (_queue != null)
_queue.Close();
if (_qMgr != null)
_qMgr.Disconnect();
}
Note: Do NOT use this code 'as is', because connecting and opening a
queue should be done once and not done over and over again in a loop
(plus it does not catch any exceptions).
Also, for ALL of your MQ API calls, make sure that you use the
*_FAIL_IF_QUIESCING option.
Regards,
Roger Lacroix
Capitalware Inc.
At 12:41 PM 12/16/2013, Ryan Finnesey wrote:
>Thank you I have a follow up question.... I will be getting
>messages off of a remote queue and then putting them on a Azure
>Service Bus queue. If I do not want the message deleted from the
>remote queue until it is committed to the Azure Service Bus would I
>have to use the transactional client?
>
>Cheers
>Ryan
>
>
>-----Original Message-----
>From: MQSeries List [mailto:MQSERIES-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org] On
>Behalf Of Roger Lacroix
>Sent: Monday, December 16, 2013 12:37 AM
>To: MQSERIES-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org
>Subject: Re: MQ and .net
>
>Hi,
>
>If you want support then you need to install the client.
>
>Regards,
>Roger Lacroix
>Capitalware Inc.
>
>At 11:34 AM 12/15/2013, you wrote:
> >Am I correct that with both .Net managed and non-managed modes I still
> >require the MQ Client installed?
> >
> >Would be a much better solution for us if a client install was not
> >required
> >
> >
> >Sent from my iPad
> >
> > > On Dec 13, 2013, at 1:46 PM, "Roger Lacroix"
> > <roger.lacroix-***@public.gmane.org> wrote:
> > >
> > > Hi Ryan,
> > >
> > > Yes. .NET 'managed' and 'non-managed' modes.
> > >
> > > - .NET managed mode is kind of similar to MQ based Java/JMS (you
> > only need the amqmdnet.dll).
> > > - .NET non-managed mode is the same as running a native MQ application.
> > >
> > > Here is the link to the Using .NET:
> > >
> > http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/topic/com.ibm.mq.dev.doc/
> > q029250_.htm
> > >
> > > Regards,
> > > Roger Lacroix
> > > Capitalware Inc.
> > >
> > > At 03:32 PM 12/13/2013, you wrote:
> > >> I understand there are two different ways for a .net application
> > to interact with MQ messages. Does anyone know where I can find
> > information comparing the two?
> > >>
> > >> Cheers
> > >> Ryan
> > >>
> > >>
> > >> Sent from my iPad
> > >> To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and, in
> > >> the message body (not the subject), write: SIGNOFF MQSERIES
> > >> Instructions for managing your mailing list subscription are
> > >> provided in the Listserv General Users Guide available at
> > >> http://www.lsoft.com
> > >> Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html
> > >
> > > To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and, in
> > > the message body (not the subject), write: SIGNOFF MQSERIES
> > > Instructions for managing your mailing list subscription are
> > > provided in the Listserv General Users Guide available at
> > > http://www.lsoft.com
> > > Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html
> >
> >To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and, in the
> >message body (not the subject), write: SIGNOFF MQSERIES Instructions
> >for managing your mailing list subscription are provided in the
> >Listserv General Users Guide available at http://www.lsoft.com
> >Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html
>
>To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and, in
>the message body (not the subject), write: SIGNOFF MQSERIES
>Instructions for managing your mailing list subscription are
>provided in the Listserv General Users Guide available at http://www.lsoft.com
>Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html
>
>To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and,
>in the message body (not the subject), write: SIGNOFF MQSERIES
>Instructions for managing your mailing list subscription are provided in
>the Listserv General Users Guide available at http://www.lsoft.com
>Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html
To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and,
in the message body (not the subject), write: SIGNOFF MQSERIES
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html