Welcome to MSDN Blogs Sign in | Join | Help

Moving MSMQ applications from 32-bit to 64-bit archirtecture

Migrating MSMQ applications from 32-bit to 64-bit systems shouldn't be a big deal.

In theory you will probably be able to just recompile / redeploy as the public MSMQ APIs are not architecture-dependent. Other parts of your own code may be, though, so make sure you check the Getting Ready for 64-bit Windows MSDN article to learn about pointer usage rules and new data types.

Also the MSMQ message format doesn't change so you can send between different architectures without worry. It is more important to note message format differences between operating systems than between hardware archirecture.

Everything is not perfect in the garden, though, as there are some old MSMQ utilities that are not designed to run on 64-bit. For examples:

There have also been some minor bugs relating to 64-bit architecture:

And some features are not supported:

I'll add more to the blog post as I find it.

Posted by JohnBrea | 0 Comments
Filed under: ,

You can't move a delivered MSMQ message

Quite often I see people discussing moving messages between queues and this mildly grates on my nerves.

Delivered messages can't be moved out of the queue they end up in - the only thing you can do is delete the message, either through receving it, purging the queue it is in, or waiting for any TimeToBeReceived timer to expire.

What is really meant by "moving" is to take the data from one message and use it to create a new message in a different queue. It is important to understand this for a couple of reasons:

  • MSMQ will regard the two messages as being different due their unique MessageID values.
  • Receiving a message from a queue will kick off any linked activities:
    • commiting the transaction used for ensuring removal of messages sent to transactional queues by creating acknowledgements to go back to the original sending machine (if requested when sent)
    • creating copies in the original destination's journal queue (if target journaling enabled on the queue)

If the applications used to send and receive messages don't implement any functionality that relies on MessageID and/or receipt acknowledgements then there won't be anything to worry about. For more sophisticated applications, moving messages between queues has the potential to break things.

Posted by JohnBrea | 0 Comments
Filed under: ,

Future of the MSMQ-MQSeries Bridge

With the announcement of Host Integration Server 2009 R2, there has been an update to the list of Deprecated Features:

  • COM+ AS/400 Data Queues ActiveX Control
  • COM+ Host File Transfer ActiveX Control
  • COM+ support throughout TI and BAHA
  • DLC.SYS
  • MSMQ-MQSeries Bridge
  • ODBC Driver for DB2
  • TI Rapid Deployment

As a Bridge replacement, the HIS team recommends using Microsoft BizTalk Server 2009 R2 in conjunction with one of the two Microsoft BizTalk Adapters for IBM WebSphere MQ (MQ Series), or the Microsoft WCF Channel for WebSphere MQ.  

Note that the MSMQ-MQSeries Bridge is still supported until 9th July, 2019 if you're running HIS 2009 "R1".

Posted by JohnBrea | 0 Comments

Host Integration Server 2006 Service Pack 1 released

This service pack is now available for download from the Microsoft download centre.

Overview
Host Integration Server 2006 Service Pack 1 delivers customer requested hotfixes that improve the quality, reliability and supportability of Host Integration Server 2006 and BizTalk Adapters for Host Systems.

A complete list of the customer hotfixes included in Service Pack 1 will be available in the following Microsoft Knowledge Base article:

979238: A list of the bugs that are fixed in Host Integration Server 2006 Service Pack 1

Posted by JohnBrea | 0 Comments

SP1 for Microsoft BizTalk Server 2006 R2 has been released

The service pack is available now from the Microsoft Download Centre.

There's a list of fixes included in BizTalk 2006 R2 SP1 at the Biztalk Customer Response Team's blog and in the Knowledgebase.

Here's the blurb: 

SP1 includes a roll-up of hotfixes from the BizTalk Server 2006 and 2006 R2 releases, some hotfixes from the BizTalk Server 2009 release, as well as some additional enhancements. Some of the key fixes and enhancements in this service pack are the following:

New Features

  • For WCF-Custom and WCF-CustomIsolated Adapters, the ability to look up custom bindings from locations other than machine.config. 
  • Support for using multiple certificates to sign outgoing AS2 messages

Better reliability, performance, and scale for the following key features

  • Throttling and dehydration of orchestrations.
  • Archiving and purging operations.
  • BAM alerts and archiving.
  • HIPAA.
  • Reduced memory consumption in scenarios using scripting functoids.
  • Improvement in the bts_FindSubscription stored proc, resulting in faster execution and lower CPU utilization.

Better management and deployment experiences

  • Performance and user experience improvements of key scenarios.
  • WCF configuration management.
  • Significant improvement in deployment time for send ports using a map.

Improved support

  • X12 and EDIFACT updates.
  • Increased footprint of supported FTP servers and locale.
  • XMLDocument message types in orchestrations.
  • Configurable timeout for Basic HTTP.
  • WCF adaptor now suspends messages instead of terminating when the host instance is stopped.
  • Configurable transaction timeout for WCF Adaptors.
  • Mapping of inline schema for SQL Adaptor now allows for using $ characters as part of the updategram.
  • The SQL Adaptor now supports calling from a BizTalk Server dynamic send port. The following properties can be set on the call to the dynamic port:
          Connection string (all the SQL connection properties)
          Document Target Namespace
          Response Document Root Element
  • Ability to disable generation of Routing Failure Report.
  • Fixes to some issues that used to cause high CPU usage by BizTalk Server hosts due to certain .NET updates.
  • Ability to use multiple certificates for signing outbound messages.
  • Message Pack 2009.
  • Message property tracking with BAM for all messages in the interchange, irrespective of the usage of pipeline or mapping.
  • Integrated tracing to help in debugging EDI specific issues. This improvement is aimed at reducing the time taken for diagnosing and isolating an EDI problem.  
Posted by JohnBrea | 0 Comments
Filed under:

MSMQ branch missing in Computer Management

Rob Fox has blogged today about how he resolved a problem where the MSMQ snap-in missing in MMC console. He found that re-registering the MQSNAP.DLL file did the trick.

I've had a look at the support case archive and you may need to re-register ATL.DLL too first. It all depends on what the root cause is and tools like Process Monitor should help to isolate it.

Note - don't get caught out by a stopped MSMQ service; this state will ensure "Message Queuing" doesn't appear under "Services and Applications" in the same way.

Posted by JohnBrea | 0 Comments
Filed under: ,

How to tell if MSMQ is actually in use on a server

Let's say MSMQ is part of your company's standard server build but you have been given the objective of removing the MSMQ service from those machines that do not require it. If you are handed responsibility for servers where there is no documentation and the previous support staff have moved on to other jobs then this job is going to be tricky. Just checking a server for running applications will not be enough as any local queues can be accessed from anywhere in your network, not just the hosting machine. There are no reports in the event logs that describe message activity, for example, so you may need to get imaginative. Also, the search for MSMQ activity can take a while as there is no reason to believe that all applications within the company will want to send or receive messages 24 hours a day. Some applications could be used for monthly reports which may take weeks to identify if you are unlucky in when you start looking.

Journaling

You can enable journaling on a queue to check if messages have been read from it. Each time a message is processed, a copy will be created in the corresponding journal queue. After a while, check the journal queue for messages with Computer Management; alternatively, write a small app to monitor the queue or set up a trigger. As a safety measure, set a low quota on the journal queue to ensure the message copies don't get out of hand and fill the system. Don't forget to purge the journal queue when you've finished.

You cannot enable journaling as easily on a machine that could be sending messages - source journaling is enabled in the code so you would need to deploy an update to all those machines running this particular application. Without such a code change, journaling is not possible for successfully sent messages.

 

Network Monitor 

MSMQ uses a number of ports for message transfer so a long-running a sniff for traffic on these will highlight the machines involved.

 

Auditing

Just like for files and folders, an MSMQ queue can be audited to show who/what accessed it.
[[Note to self - must experiment with this feature more...]]

 

Performance Monitoring

There are two objects of use here - MSMQ Service and MSMQ Queue. The following counters will help highlight activity:

  • MSMQ Service\MSMQ Incoming Messages
  • MSMQ Service\MSMQ Outgoing Messages
  • MSMQ Service\Sessions
  • MSMQ Service\Total messages in all queues

The Incoming/Outgoing Messages counters are a cumulative total for messages received or sent over the network. These are useful for showing that the machine interacts with others on the network, as will be the Sessions counter.

Use the "Total messages in all queues" counter to look for local activity where messages are created and consumed all on the same machine (and so doesn't appear in the Incoming/Outgoing Messages counters).

If you do detect activity then the MSMQ Queue counters can provide data on which queues are being used and so hopefully lead you to identify the applications generating the messages.

 

Checking the Storage directory

Messages are written to files in the %windir%\System32\msmq\storage directory. Checking the timestamps on the *.MQ files here may provide some useful information. Note that care should be taken here as the "Accessed" date and time does not show the last occasion a message was written to storage but rather when the storage file, or its properties, was last read.

 

Disable the service

Primitive but can provide good data - switch off the service and listen out for people complaining that their applications have stopped working. Be prepared to react quickly to re-enable services on machines you do need to be running MSMQ!

Posted by JohnBrea | 0 Comments
Filed under:

MSDN Video covering the removal from MSMQ 5.0 of the Windows 2000 client support service

And 3rd in the trio created for Windows 7 / Windows 2008 R2, we have:

Microsoft Message Queuing (MSMQ) - Removal of Windows 2000 Client Support Service

where Nancy Strickland discusses the impact of installing Windows 2008 R2 domain controllers on Windows 2000 machines running MSMQ applications.

MSDN Video discussing improved queue handling in MSMQ 5.0

Here's a short (3 minute) video from December covering an improvement on performance introduced in MSMQ 5.0. I'm not sure it's worth the coverage as the number of systems with vast numbers of queues is pretty small but there you go.

Microsoft Message Queuing (MSMQ) - Improved Queue Handling 

Again voiced by Nancy Strickland and with poor video quality - there must be a better way to encode a text-based PowerPoint slide deck.

MSDN Video demonstrating MSMQ 5.0 and SHA-2 incompatibility

Just noticed that MSMQ is featured on Microsoft Showcase as part of the "Windows 7 - Known Incompatibilites" series.

Microsoft Message Queuing (MSMQ) - SHA-2 is the default Hash Algorithm, and how to overcome it

This 8 minute video, voiced by Nancy Strickland, covers the changes to the default hash algorithm used by MSMQ and what that means for sending messages between systems running different operating systems. There's a demo on how to edit the registry to change the defaults.

Note that the video quality is pretty poor - I tried this on three different machines just to check - but the audio is clear. So don't try to watch the video without audio as reading the slides, and especially following the registry editing demo, will be hard work.

"Where have my MSMQ messages gone?"

A reasonably common question, this.

It is important to note that MSMQ doesn't lose your data. There's no hole at the bottom of a queue where small messages can accidentally fall out, never to be seen again. Instead MSMQ will discard messages in certain circumstances unless told otherwise.

Here are a range of scenarios which explain why messages seem to disappear without reason. You may think that I'm inventing purely theoretical situations for some of these but you'd be wrong - all of the following are based on real customer cases.


Time-to-live for message is too short
MSMQ allows two different message timers:

  • Time-To-Reach-Queue (TTRQ) - the time allowed for the remote server to confirm message delivery into the destination queue
  • Time-To-Be-Received (TTBR) - the time allowed for the remote server to confirm the message has been read from the destination queue

The defaults are quite generous - 4 days and infinite respectively. So an undelivered message can sit in an outgoing queue for up to 4 days before being removed by MSMQ and remain in the destination queue indefinitely. Should someone set the default lifetime for messages to a short value or specifically assign one in their application code then a delay in the system, such as a network outage, could cause messages to unexpectedly expire. If negative source journaling has been enabled then these messages should be in the sending machine's dead letter queue with an explanation that the timer expired. If you don't have journaling then the message is discarded.

Incorrect queue or message property
If a message is sent with properties that don't match the destination then it will be discarded. The common properties that can be misapplied are:

  • Transactional message to non-transactional queue, and vice versa
  • Queue requires authentication but no certificates used in the message
  • Queue requires encryption but no certificates used in the message
  • ... and there are probably others.

As with the timers, if negative source journaling has been enabled then these messages should be in the sending machine's dead letter queue with an appropriate explanation. If you don't have journaling then the message is discarded.

Express messages lost when MSMQ service is restarted
If you want a message to survive a reboot then it must be set as recoverable in the application. Although express messages are copied to the disk, this is not to make them persistent. As a result, when the MSMQ service starts up again all the express messages are immediately discarded. Transactional messages are recoverable by design and no extra action is required for these.

Server name used to address message doesn't match destination machine
When MSMQ receives a message from over the wire, it always validates that this machine is the correct recipient. This is to ensure that something like a DNS misconfiguration does not result in messages being delivered to the wrong place. The messages are, instead, discarded unless the IgnoreOSNameValidation registry value is set appropriately. You may want to do this with an Internet-facing MSMQ server, for example, where the domain and server names visible to MSMQ clients on the Internet often bear no resemblance to the real ones (for good security reasons).

Receiving application experiences a problem
Here the message has been successfully delivered to the destination queue and has been received but the application encounters a problem. Maybe a back-end database is offline and the message body cannot be written as a record to it. If the message is not received within a transaction (which can abort and roll back) then such a fault could mean the message is lost. An alternative to using transactions is to perform a peek and then a receive; the peek is used to read the message data for processing and the receive is to effectively delete the message should the peek be successful; if the peek failed then the message is still in the queue and a retry is possible. Journaling on the queue itself is a useful step as a copy of the message in the queue's journal queue shows the message was successfully read.

Multiple applications are accessing the same queue without your knowledge
It is really hard to work out which applications are pulling messages from a queue and they could be physically located anywhere on the network. There's no query you can run to show what applications have open queue handles on a queue or have pulled messages from the queue in the past. You may be able to get a clue by running a security audit on the queue as the account used to gain access to the queue may, if you're lucky, indicate a particular machine as the source. Again, use journaling on the queue to prove the message had been delivered and removed correctly.

The server is switched off and the hard drive has write caching enabled
This has been covered in another blog post.

 

I'll come back to this blog post over time as more scenarios occur to me.

 

Posted by JohnBrea | 0 Comments
Filed under: ,

Transactional MSMQ on a cluster

Before Windows 2008 (MSMQ 4.0) there was only one option if you needed to read messages transactionally on a high availability cluster - the application had to be clustered in the same resource group as the MSMQ service hosting the queues. This was because only local receive operations could be transactional on Windows 2003 (MSMQ 3.0).

Now remote receives can be transactional so the application can be run elsewhere, such as on the local nodes, which makes development / testing / administration that much easier.

There is a caveat to this - you will experience a performance difference between local and remote receive operations which makes the decision where to locate applications less clear cut. There are two reasons for this:

  1. Receive operations use RPC. If the application and MSMQ resource are working together, local RPC (LRPC) function calls are made. If the application is remote then the transport protocol has to be used at both ends, adding a large overhead.
  2. For sending messages transactionally over the wire, MSMQ employs its own lightweight mechanism that uses acknowledgement messages. Receiving messages remotely, though, requires DTC for the transactional support which is a much more heavyweight method.

References

[[Thanks to Joseph Donahue for typo checking]]

Posted by JohnBrea | 2 Comments
Filed under: , , ,

Real-world application of MSMQ - Warthogs and laser tagging

Over at PDC09, one of my colleagues, Paul Foster, had a chance to talk to Tim Higgins about his WiFi Warthogs and how they are controlled by MSMQ.

(Well, they talked about a lot of other stuff too but MSMQ is definitely in there after 5:18).

Here's the YouTube video explaining what the project is about:

PDC09: Project Warthog

"Played Halo? Will how about taking your coding and Xbox gaming skills to the real world with Project Warthog. With customised child ride-ons equipped with laser shooters under computer control via Xbox 360 controls, you and your mates can enjoy that Warthog experience in the real world. Personally, I want to see the 50 cal humvee version of the game. Maker Faire anyone? "

 

Update released for MSMQ 3.0 Management Pack

This week the Management Pack for MSMQ 3.0 (Windows 2003/XP) was updated to version 6.0.6615.0. I would list the changes but, after looking at the documentation, there appear to be several pages of them although the following two would appear to be pretty useful:

·         Fixed a problem when working with an instance of MSMQ in a Cluster. The MP is now able to discover and monitor public and private queues in a cluster.

·         Fixed a problem when discovering the local and cluster instance of MSMQ. The MP is now able to discover and monitor both instances.

[[Edited 23rd December, 2009]] 

More comment:

Posted by JohnBrea | 0 Comments
Filed under: , ,

Deleting Stale MSMQ Active Directory Objects

[Sharing some information that comes in handy internally]

If you have installed the MSMQ AD integration feature on a domain-joined machine but are unable to see public queues then you may have a stale MSMQ object in Active Directory. This is a common occurance in test labs where machines are reimaged and rejoined to the same domain without uninstalling MSMQ.

The following articles have the required resolution steps under the section titled “Remove stale Active Directory objects”:

Event ID 2116 — Active Directory Integration Configuration
Event ID 2164 — Message Queuing Functioning in Domain Mode

References:

Posted by JohnBrea | 0 Comments
Filed under: ,
More Posts Next page »
 
Page view tracker