Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

BizTalk 2010 Recipes : Adapters - Configuring MSMQ Receives

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
4/23/2011 4:43:06 PM

1. Problem

You are integrating with a system that publishes messages to an MSMQ queue, and you must configure BizTalk Server to receive messages from MSMQ.

2. Solution

You are building a solution that processes orders from an online commerce site that outputs order messages to an MSMQ queue. To receive messages from the queue, you must create a BizTalk Server receive location that utilizes the MSMQ adapter. To configure the receive location, follow these steps:

  1. Open the BizTalk Administration Console.

  2. Expand the BizTalk Server group, select an appropriate BizTalk application, and select the Receive Ports folder.

  3. Right-click the Receive Ports folder, and select New→One-way Receive Port to open the Receive Port Properties dialog box.

  4. Give your new receive port a descriptive name, and click OK.

  5. Right-click the receive port created in the previous step, and select New→Receive Location. The Receive Location Properties dialog box appears.

  6. Give your receive location a descriptive name, select the XMLReceive pipeline, and select MSMQ as the transport type.

  7. Click the Configure button to the right of the Transport Type field. This launches the MSMQ Transport Properties dialog box.

  8. Set the Queue property to the queue name that the online commerce site outputs messages to, as shown in Figure 1. In this scenario, we are using a queue named CommerceOrder.

  9. Leave all the other properties with their default values, and click OK.

  10. Click OK in the Receive Location Properties dialog box to save the receive location.

    NOTE

    You can also create receive ports and receive locations in the BizTalk Editor view in Visual Studio.

    Figure 1. Configuring an MSMQ receive location
  11. Select the Receive Locations folder in the BizTalk Administration Console, right-click the receive location created earlier, and select Enable.

3. How It Works

The BizTalk Server MSMQ adapter allows easy access to messages in MSMQ queues (MSMQ versions 2.0 and 3.0). The adapter relies on the local MSMQ service, which must be installed on the same computer hosting the adapter.

4. MSMQ Receive Options

Although this example illustrates the simplest scenario for receiving MSMQ messages from a specified queue, you can make a number of configurations against the MSMQ adapter:

  • Queue: Specifies the queue from which to receive messages. Each queue must be polled by only one receive location per BizTalk environment. See the following section for further information about how to format queue names.

  • Ordered Processing: Specifies whether the message order is persisted in the MessageBox. If this property is set to True, only one message is received in each batch (one message retrieved each time the receive location polls the queue). This property enables a solution to implement ordered message delivery, although you must also ensure that any subsequent processing (including the delivery of the message to a destination system) is handled serially if order is to be maintained. A True value for this property overrides the Batch property, essentially setting its value to 1.

  • On Failure: Specifies the action the adapter should take on the receive location if an error occurs. These are the available values:

    • Stop: The receive location will be stopped.

    • Suspend (nonresumable): The receive location will remain enabled, with error messages being suspended in a nonresumable state.

    • Suspend (resumable): The receive location will remain enabled, with error messages being suspended in a resumable state.

  • Batch Size: Specifies the number of MSMQ messages to be handled in a single batch. The default value of 0 indicates an unlimited number of messages in a batch. The MSMQ adapter retrieves messages from a queue and submits them to the MessageBox in batches of one to many messages.

  • User Name: Specifies the user for accessing a remote queue. This property applies only when accessing remote queues. The MSMQ adapter's host account is used to access all local queues.

  • Password: Specifies the password for accessing a remote queue. This property applies only when accessing remote queues.

  • Transactional: Specifies whether the receive location will retrieve messages transactionally. This property must be set to True if the source queue is transactional and False if the source queue is not transactional.

    If the Transactional property is set to True, the MSMQ adapter transactionally retrieves the appropriate number of messages into a batch and attempts to submit the batch to the MessageBox within the transaction. If any errors are encountered when submitting the messages, the MSMQ adapter attempts to suspend the messages that have errors. If any errors are encountered when suspending the error messages, the MSMQ adapter rolls back the receive transaction (which leaves the messages in their original location—in the MSMQ queue). Messages within a batch are handled individually; those messages that do not encounter errors are submitted to the MessageBox, even if other messages in the batch have errors.

    If the Transactional property is set to False, the MSMQ adapter retrieves the appropriate number of messages in a batch and attempts to submit the batch to the MessageBox. If any errors are encountered when submitting the batch, the MSMQ adapter attempts to suspend the messages. If any errors are encountered when suspending the batch, the messages are lost.

NOTE

The MSMQ adapter does not support transactionally receiving messages from a remote queue. If the queue is remote, message batches will be retrieved nontransactionally, regardless of the configuration of this property.

As a batch is submitted to the MessageBox, errors can occur in messages. They pass through the receive pipeline configured on the receive location, pass through the map configured on the receive port, or are written to the MessageBox database.

You should consider the performance impact when using the MSMQ adapter. It is important to understand the volume and size characteristics of the messages you expect to receive via MSMQ, because they can significantly impact your BizTalk Server resources. You should pay particular attention to the following:

Threading: BizTalk Server attempts to allocate threads to each MSMQ receive location as it polls its queue. Depending on how many messages are in the source queue, multiple threads may be allocated to each receive location. By default, the number of active threads allocated to the MSMQ adapter cannot exceed 25. If you have more than 25 messages being retrieved at any one time, it is possible to have latency.

Memory allocation: As message batches are retrieved by MSMQ receive locations, they are stored in memory until they are written to the MessageBox. The larger these batches are, the more memory is allocated. To throttle the amount of memory used by the MessageBox adapter, you can use the BatchSerial Processing properties. You can limit the number of messages in any given batch by setting the Batch property to a low value. You can also set the Serial Processing property to True, which limits the MSMQ receive location to retrieving a single message in each batch. Memory allocation is particularly important if you have implemented the large message extension for message queuing, which allows messages larger than 4MB in size to be handled by the MSMQ adapter. See the SDK example devoted to this topic for further information. and

It is important to understand the relationship of these configurations and the impact they have on system resources. The ideal configuration of threading, serial processing, and batch processing is specific to each BizTalk environment. Optimization should be part of the performance-testing phase for all solutions you deploy to your BizTalk Server environment.

5. MSMQ Queue Name Formats

To successfully read messages from an MSMQ queue, you must appropriately format the name of the queue via the Queue property. The appropriate name depends on the type and location of the queue. The following list defines the way the Queue property should be entered for the commonly implemented queues:

  • Public queue: ComputerName\QueueName

  • Private queue: ComputerName\Private$\QueueName

  • Direct access to a queue via TCP: DIRECT=TCP:IPAddressOfComputer\QueueName

By default, the MSMQ adapter prepends FORMATNAME:DIRECT=OS: to the Queue property, assuming the queue is referenced directly via the host computer's name.
Other -----------------
- BizTalk 2010 Recipes : Adapters - Configuring MSMQ Sends
- Windows Server 2008 R2 : Windows Media Services - Broadcasting a Live Event
- Windows Server 2008 R2 : Windows Media Services - Understanding Windows Media Encoder
- Windows Server 2008 R2 : Windows Media Services - Combining Multiple Files for a Combined Single Broadcast
- High-Level Guide for Transition from Exchange Server 2007 to Exchange Server 2010
- High-Level Guide for Transition from Exchange Server 2003 to Exchange Server 2010
- Migrating from Active Directory 2000/2003 to Active Directory 2008 : Multiple Domain Consolidation Migration (part 2)
- Migrating from Active Directory 2000/2003 to Active Directory 2008 : Multiple Domain Consolidation Migration (part 1)
- Windows Server 2003 : Planning an IPSec Implementation (part 2) - IPSec Protocols & Transport Mode and Tunnel Mode
- Windows Server 2003 : Planning an IPSec Implementation (part 1) - Evaluating Threats & Introducing IPSec
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server