Increase transaction timeout

386 views
Skip to first unread message

Marcio Fabio Althmann

unread,
Jul 26, 2011, 1:42:45 PM7/26/11
to masstrans...@googlegroups.com

Hello,

In Worker, to increase transaction timeout just set below configuration, right?

 

factory.SetDefaultTransactionTimeout(new TimeSpan(0, 0, 3, 0));

 

Thanks

 

Márcio Fábio Althmann

Chris Patterson

unread,
Jul 26, 2011, 6:53:49 PM7/26/11
to masstrans...@googlegroups.com
That should do it. If reading from a transactional queue, it will create the transactionScope with that timeout value.

-- 
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To post to this group, send email to masstrans...@googlegroups.com.
To unsubscribe from this group, send email to masstransit-dis...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/masstransit-discuss?hl=en.

Marcio Fabio Althmann

unread,
Jul 27, 2011, 8:32:33 AM7/27/11
to masstrans...@googlegroups.com

In my worker, when i call a wcf to process the message information, and i’m sleeping for testing the processing of the message for 1 minute, the worker throw a transactino timeout error, with the timeout higher.

 

The code of Worker.

 

public DoWork()

        {

            _log.InfoFormat("Inicializando o Worker");

 

            LoadWorkerConfigurations();

 

            _log.InfoFormat("Inicializando módulos");

 

            LoadNinjectModules();

 

            _log.Info("Inicializando o ServiceBus");

 

            DataBus = ServiceBusFactory.New(factory =>

                {

                    factory.ReceiveFrom(_sourceQueue);

                    factory.SetPurgeOnStartup(false);

 

                    factory.UseMsmq();

                    factory.UseMulticastSubscriptionClient(client => client.SetNetworkKey(_networkKey));

 

                    factory.SetConcurrentConsumerLimit(_concurrentWorkerLimit);

                    factory.ImplementDistributorWorker<EntitySaveMessage>(ConsumeEntitySaveMessage, _progressLimit, _pendingLimit);

                    factory.ImplementDistributorWorker<EntityCallRecordContextMessage>(ConsumeEntityCallRecordContextMessage, _progressLimit, _pendingLimit);

                    factory.ImplementDistributorWorker<EntityCallTableContextMessage>(ConsumeEntityCallTableContextMessage, _progressLimit, _pendingLimit);

                    factory.SetDefaultTransactionTimeout(new TimeSpan(0, 10, 0));

 

                    factory.UseControlBus();

                });

 

            ControlBus = DataBus.ControlBus;

 

            _log.Info("ServiceBus inicializado");

        }

 

Log

ERROR 27-07-2011 09:31:03 - Consumer Exception Exposed

System.Transactions.TransactionAbortedException: The transaction has aborted. ---> System.TimeoutException: Transaction Timeout

   --- End of inner exception stack trace ---

   at System.Transactions.TransactionStatePromotedAborted.BeginCommit(InternalTransaction tx, Boolean asyncCommit, AsyncCallback asyncCallback, Object asyncState)

   at System.Transactions.CommittableTransaction.Commit()

   at System.Transactions.TransactionScope.InternalDispose()

   at System.Transactions.TransactionScope.Dispose()

   at MassTransit.Transports.Msmq.TransactionalInboundMsmqTransport.Receive(Func`2 callback, TimeSpan timeout)

   at MassTransit.Transports.Transport.Receive(Func`2 callback, TimeSpan timeout)

   at MassTransit.Transports.Endpoint.Receive(Func`2 receiver, TimeSpan timeout)

   at MassTransit.Context.ServiceBusReceiveContext.ReceiveFromEndpoint()

Reply all
Reply to author
Forward
0 new messages