Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 48499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:17:22+00:00 2026-05-10T16:17:22+00:00

I am writing a Windows service that pulls messages from an MSMQ and posts

  • 0

I am writing a Windows service that pulls messages from an MSMQ and posts them to a legacy system (Baan). If the post fails or the machine goes down during the post, I don’t want to loose the message. I am therefore using MSMQ transactions. I abort on failure, and I commit on success.

When working against a local queue, this code works well. But in production I will want to separate the machine (or machines) running the service from the queue itself. When I test against a remote queue, an System.Messaging.MessageQueueException is thrown: ‘The transaction usage is invalid.’

I have verified that the queue in question is transactional.

Here’s the code that receives from the queue:

// Begin a transaction. _currentTransaction = new MessageQueueTransaction(); _currentTransaction.Begin();  Message message = queue.Receive(wait ? _queueTimeout : TimeSpan.Zero, _currentTransaction); _logger.Info('Received a message on queue {0}: {1}.', queue.Path, message.Label); WORK_ITEM item = (WORK_ITEM)message.Body; return item; 

Answer

I have since switched to SQL Service Broker. It supports remote transactional receive, whereas MSMQ 3.0 does not. And, as an added bonus, it already uses the SQL Server instance that we cluster and back up.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T16:17:23+00:00Added an answer on May 10, 2026 at 4:17 pm

    I left a comment asking about the version of MSMQ that you’re using, as I think this is the cause of your problem. Transactional Receive wasn’t implemented in the earlier versions of MSMQ. If that is the case, then this blog post explains your options.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 62k
  • Answers 62k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer for ( i = 10 ; i-- > 0 ;… May 11, 2026 at 10:09 am
  • added an answer I would strongly suspect not. Typically, you don't have any… May 11, 2026 at 10:09 am
  • added an answer You can use the excel pivot table feature to reverse… May 11, 2026 at 10:09 am

Related Questions

I am writing a Windows service that pulls messages from an MSMQ and posts
I am writing a windows service. This service runs another process I've developed through
I am writing a windows service in VS2008 - c#. When I double click
Maybe you can help me... I am writing a program in Windows Mobile that
I am writing a command-line tool for Windows that uses libcurl to download files
I am writing a batch file script using Windows command and want to change
I am about to start on a journey writing a windows forms application that
For a windows script I am writing, I need to detect if the machine
I am writing a query in which I have to get the data for
I am writing a few extensions to mimic the map and reduce functions in

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.