MSMQA adapter problem RRS feed

  • Question

  • I created sequential convoy using MSMQ. Only dropped one message in the queue and my orchestration ran into infinite loop. If I change my port to use File adapter, there is no problem at all. Here is my orchestration. ( I inserted the image, but the forum said 

    • Body text cannot contain images or links until we are able to verify your account.

    how to verify my account?)

    When using MSMQ adapter for the port Port_SPC_SC, the Receive shape Receive_SPC always receives same message as the Receive shape Receive_SPC_Init. During the infinite loop, I checked the message queue and there were no message at all. I don't know why the same message comes in all the time. 

    If switched to File adapter, there is no infinite loop at all. The message just was processed once and done. Why MSMQ adapter cannot work with sequential convoy?

    Thanks in advance!!!

    Wednesday, July 1, 2015 5:52 PM

All replies

  • Hi,

    Do you have orchestration ports directly bounded  to message box ? or any custom pipeline for message construct  which you are publishing to message box.



    Wednesday, July 1, 2015 6:12 PM
  • No, orchestration receive port is bounded to the physical port using MSMQ adapter. No custom pipeline used.
    Wednesday, July 1, 2015 6:51 PM
  • Hi ,

    Can you try checking subscription of your Orchestration through BizTalk Administration console. Also if possible can you copy the Orchestration flow image once more time .



    Thursday, July 2, 2015 9:09 AM
  • Regardless of the Adapter, if you Orchestration is entering an infinite loop, that's a procedural problem in the Orchestration.  What is you Loop Shape exit criteria?

    MSMQ sourced messages work fine with a Sequential Convoy so it's not a system problem.

    Thursday, July 2, 2015 10:14 AM
  • I tried to insert the image, I still can. I'll logout and login again to see if I can do it.

    Send_1 shape just sends the modified file to output folder. 

    The exit criteria is not receiving any messages for 5 minutes.

    The way message inserted to the private message queue is also to use MSMQ adapter. That send port subscribes the specified message type and the specified promoted property from BizTalk message box. As I said, during the infinite loop, I kept refreshing the private queue. I never saw there was message in the queue. So I believe the send port didn't insert new messages into the queue.

    The receive port uses MSMQ adapter to get message from the queue. When debugging the orchestration, Receive_SPC shape always received message to process, so the loop never ends.

    Thursday, July 2, 2015 4:13 PM
  • When inserting the image, I got the popup saying:

    The page at says:

    Body text cannot contain images or links until we are able to verify your account.

    Thursday, July 2, 2015 4:17 PM
  • Since I cannot insert the image, I just describe the orchestration. 

    It is very simple orchestration. The first receive shape initiates to the correlation set followed by Loop shape with boolean variable set to true. Inside the loop, first is Construct Message shape modifying the promoted property of the incoming message. Then Send_1 shape just sends the modified message to the send port using File adapter. Then Listen shape: one branch contains just Receive shape to follow the correlation set; the other branch contains Delay shape to wait for 5 minutes, then set loop boolean variable to false.

    Thursday, July 2, 2015 4:32 PM
  • If the Activation and Correlation is based on MessageType only, then you will have an infinite loop since MessageType is again Promoted on the Send Shape.

    The Activation subscription has to have some other predicate to differentiate new vs. processed messages.

    Thursday, July 2, 2015 6:44 PM
  • Activation and Correlation is based on MessageType and the promoted property. Construct Message shape modifies that promoted property to prevent the receive port to receive it again.
    Thursday, July 2, 2015 7:05 PM
  • Modifies what Property?  You can't change MessageType.
    Thursday, July 2, 2015 7:57 PM
  • I checked there is no activation filter set. The correlation set is BTS.MessageType and Common.Schema.CompanyId

    My message schema has the promoted property - IsRunnable. The sent port filter for the message queue is 

    Common.Schema.IsRunnable == true  And
    BTS.MessageType ==  And
    Common.Schema.ProcessId == 70

    The receive port for the message queue has no filter set.

    Why using File adapter for receive port won't create infinite loop?

    Thursday, July 2, 2015 9:32 PM
  • I think there is bug in MSMQ adapter. It reads its own message over and over again.

    This problem can be easily reproduced using sequential convoy. Inside the orchestration, you don't need to create any new message, just put an expression shape inside the loop to print the counter to DebugView. Use MSMQ send port to send message to a private queue; and use MSMQ receive port to read the message in the queue. Just drop one message to the queue, then the infinite loop will start. You will see the counter starting 1, 2, 3, 4, .... If you disable the receive port, the loop stops and the counter stops printing, and there is no message in the queue either. Enable the receive port, the loop continues and the counter starts printing numbers again.

    Tuesday, July 7, 2015 6:07 PM