ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » Async Consumer and use of TransactionScope

Post new topic  Reply to topic
 Async Consumer and use of TransactionScope « View previous topic :: View next topic » 
Author Message
johnsimons
PostPosted: Tue Apr 02, 2013 9:10 pm    Post subject: Async Consumer and use of TransactionScope Reply with quote

Newbie

Joined: 18 Mar 2013
Posts: 5

When receiving messages using the syncronous method, eg:
Code:
using (var scope = new TransactionScope(TransactionScopeOption.Required, transactionOptions))
{
       message = consumer.Receive(1000);

       if (message != null)
       {
            //Do work here
            scope.Complete();
       }
}


But if I want to use the asynchronous method:
Code:
consumer.MessageListener = delegate(IMessage msg)
{
    //Do work here
    //But where do I put TransactionScope?
};


I can't work out how to wrap the MessageListener callback within a TransactionScope.

Does anyone know how to do this?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Async Consumer and use of TransactionScope
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.