none
Multiple Receive location but Single Instance of Orchestration RRS feed

  • Question

  • Hi,

    I have only one Receive Port (POP3 adapter) and multiple receive locations configured to different email IDs.

    ReceivePort1

    - Receive location1 - abc@domain.com

    - Receive location2 - xyz@domain.com

    - Receive location3 - ijk@domain.com

    If I send a mail with more than 1 recipient then that many orchestration instance is being generated.

    If I send a email where 'To' field has all three email Id also, always orchestration should instantiated only once. If I make my Orchestration as Singleton, does it help?

    Regards,

    Lakshmi

    Saturday, September 6, 2014 5:24 PM

Answers

  • That is the way e-mail works. Each recipient in the list gets their own copy of the mail.

    My question to you is why are you listening to 3 mailboxes when they are likely to get the same mail delivered to them? You should have ONE mailbox associated with a specific format. The other solution is to have ONE mailbox and a Receive Location associated with this. You may choose to have multiple MAPS associated with this ONE port.

    When an e-mail is received, the receive pipeline (POP3) will retrieve the contents and then depending on the MAP will transform it appropriately. This in turn will trigger the orchestration that subscribes to that specific message types.

    What you are doing is creating 5 different folders, tying them into ONE Port, copying the same message INTO all five of them and then wondering why five orchestrations are being triggered !! Each file that you dropped into the folder is treated as a message and since there are FIVE of them FIVE instances of the subscribing orchestration will be triggered to process them. SINGLETON will make it ONE Orchestration BUT you'd still process FIVE Messages (which will be duplicates).

    BizTalk CANNOT determine if the message is a duplicate or not, every message is an instance and would get a unique message id.

    Regards.

    • Marked as answer by Laxme Monday, September 8, 2014 6:21 PM
    Sunday, September 7, 2014 8:00 AM
  • Hi Laxme,

    • Ask the team which manages the mailboxes to create a rule for these different emailIDs. The rule should route the mails (which you want to process in BizTalk, so you can have filter) to these email ID/ mailboxes to another email ID/mailbox something like BTSEmail@doamin.com.
    • Then create a Receive port and Receive Location to receive emails from BTSEmail@doamin.com. In the port’s inbound map, apply map to convert the incoming message to the different mailbox to an canonical (common) schema
    • Create a orchestration to receive message of type of the canonical (common) schema
    • Define correlation set and types and in the correlation properties we will use the “BTS.ReceivePortName” property. This will enable you to have the convoy configured on all the messages arriving on a particular receive port. And define a singleton orchestration, if you want to have one instance of the orchestration created. Since you will have one mailbox to receive messages you can process the message in your orchestration even without the singleton orchestration depending on your actual processing requirements.


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    • Marked as answer by Laxme Monday, September 8, 2014 6:21 PM
    Sunday, September 7, 2014 9:01 PM

All replies

  • For clarity, this is not a problem with BizTalk.  What the sender might do is well outside of BizTalk's control.  Regardless of it being the same content, even the POP3 Server may view each as a separate message.

    Can a Singleton help?  Yes, if you setup the correlation on POP3.To and POP3.Subject.  But, there's still the possibility that the same To/Subject combination might still be different content.

    Depending on how the POP3 server works and how the messages were delivered, you may find a unique id in POP3.Headers field you can parse out and Promote in a Pipeline Component.

    Alternatively, the mail server may be configured to deliver all emails for abc, xyz and ikj to a single mailbox in a way that does not duplicate messages.  I'm 87% sure Exchange Server has this ability.

    Saturday, September 6, 2014 6:40 PM
    Moderator
  • We are using DIRECT Gateway Project and Visendo SMTP extender. Once It reached the IIS Pickup folder, Visendo copies that message and put into respective user folder. 

    Regards,

    Lakshmi

    Saturday, September 6, 2014 7:11 PM
  • That is the way e-mail works. Each recipient in the list gets their own copy of the mail.

    My question to you is why are you listening to 3 mailboxes when they are likely to get the same mail delivered to them? You should have ONE mailbox associated with a specific format. The other solution is to have ONE mailbox and a Receive Location associated with this. You may choose to have multiple MAPS associated with this ONE port.

    When an e-mail is received, the receive pipeline (POP3) will retrieve the contents and then depending on the MAP will transform it appropriately. This in turn will trigger the orchestration that subscribes to that specific message types.

    What you are doing is creating 5 different folders, tying them into ONE Port, copying the same message INTO all five of them and then wondering why five orchestrations are being triggered !! Each file that you dropped into the folder is treated as a message and since there are FIVE of them FIVE instances of the subscribing orchestration will be triggered to process them. SINGLETON will make it ONE Orchestration BUT you'd still process FIVE Messages (which will be duplicates).

    BizTalk CANNOT determine if the message is a duplicate or not, every message is an instance and would get a unique message id.

    Regards.

    • Marked as answer by Laxme Monday, September 8, 2014 6:21 PM
    Sunday, September 7, 2014 8:00 AM
  • Hi Laxme,

    • Ask the team which manages the mailboxes to create a rule for these different emailIDs. The rule should route the mails (which you want to process in BizTalk, so you can have filter) to these email ID/ mailboxes to another email ID/mailbox something like BTSEmail@doamin.com.
    • Then create a Receive port and Receive Location to receive emails from BTSEmail@doamin.com. In the port’s inbound map, apply map to convert the incoming message to the different mailbox to an canonical (common) schema
    • Create a orchestration to receive message of type of the canonical (common) schema
    • Define correlation set and types and in the correlation properties we will use the “BTS.ReceivePortName” property. This will enable you to have the convoy configured on all the messages arriving on a particular receive port. And define a singleton orchestration, if you want to have one instance of the orchestration created. Since you will have one mailbox to receive messages you can process the message in your orchestration even without the singleton orchestration depending on your actual processing requirements.


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    • Marked as answer by Laxme Monday, September 8, 2014 6:21 PM
    Sunday, September 7, 2014 9:01 PM
  • You can try asking the exchange guys to create a group with these email id.. A group like AppITEM1Notification@domain.com and have abc@domain.com ,  xyz@domain.com and  ijk@domain.com as group memebrs. And use AppITEM1Notification@domain.com  at ur POP3 configuration.. and now u ll have just one recv port and a rcv location.

    Regards
    Ritu Raj
    When you see answers and helpful posts,
    please click Vote As Helpful, Propose As Answer, and/or Mark As Answer


    Monday, September 8, 2014 6:19 AM
    Answerer