locked
Using Multiple Send Ports RRS feed

  • Question

  • I have a very simple orchestration that reads an POP3 email box and saves the attachemt to a folder. I have setup multiple receive locations/ports for each of the email boxes that I wish to monitor. I then setup multiple send ports with filters based on the POP3:To property. It will save the file from one of the mail boxes but the other just throws the following error message.

    The published message could not be routed because no subscribers were found. This error occurs if the subscribing orchestration or send port has not been enlisted, or if some of the message properties necessary for subscription evaluation have not been promoted.

    If i removed the filter it works but I get all message reguardless of who they were sent to. I do not know much about BizTalk so any help would be great. I am using BizTalk 2006 R2.

    Thanks

    Wednesday, September 16, 2009 8:15 PM

Answers

  • Yes, use a dynamic send port.  Then, in the orchestration you specify

    SendPort(Microsoft.XLANGs.BaseTypes.Address) = "your destination" which is your file location.  Does this make sense?
    • Marked as answer by Michael Rhoades Friday, September 18, 2009 2:56 PM
    • Proposed as answer by Alex Krotov Friday, September 18, 2009 3:44 PM
    Friday, September 18, 2009 2:31 PM

All replies

  • This may be failed because of non availability of a send port configured with the correct POP3.To value coming in the message. To troubleshoot this got to admin console, check the suspended instances. Check the suspended-non resumable instance. Open it and see in the message context property to verify the POP3.To value. Cross check if you have created a send port with filter to this value.


    Genuine Basil
    Wednesday, September 16, 2009 8:24 PM
  • You are obviously missing a subscribtion for atleast one .
    Set up a one more send port which is like SP_CatchAll ..

    Then run your scenarios..  Then check which send ports gave results and which did not .
    Look at that filter closely for typos mispells. Copy paste issues..

    It has to be something really simple..

    Wednesday, September 16, 2009 10:04 PM
  • Hi,

    Check this post: Diagnosing Routing Failures - http://winterdom.com/2006/03/diagnosingroutingfailuresinbiztalkserver2006


    What pipeline you are using? do not use PassThruReceive.

    This can be resolved by checking the basic setup of the application deployed in the server, for this please follow below steps:

    1. Verify the Send ports/Orchestrations are enlisted and started.
    2. Whenever the content based routing is implemented, make sure the Filter entries are correct especially check for space/some extra characters.
    3. Compare the Filter values with the file which got suspended, this will easy the step 2.
    4. Verify the pipeline selected.


    Sandro Pereira - http://sandroasp.spaces.live.com/blog/ http://www.devscope.net/WhatWeDo/Integration/tabid/107/Default.aspx

    Wednesday, September 16, 2009 11:13 PM
    Moderator
  • By default the POP3 adapter does not promote the POP3.To property to the message context. You can confirm this by opening HAT and seeing the request message context properties and see that the POP3.To property is not promoted. Either you have to create a custom pipeline component and promote this property into the message context or do it in an expression shape within the orchestration before sending the message to the send port.

    The context property is not promoted that is why filter on the send port is not working and you are getting a routing failure.
    Abdul Rafay http://abdulrafaysbiztalk.wordpress.com/ Please mark this answer if it helps
    Thursday, September 17, 2009 7:07 AM
  • There was a thread about this only recently, check it out - http://social.msdn.microsoft.com/Forums/en-US/biztalkgeneral/thread/17ee2e20-f2e7-4438-bd67-901a4df3503e
    Yossi Dahan http://www.sabratech.co.uk/blogs/yossidahan [To help others please mark replies as answers if you found them helpful]
    Thursday, September 17, 2009 7:42 AM
    Moderator
  • So I decided to change the filter to look at the ReceivePort since that is already promoted but there are 2, BTS.AckReceivePortName & BTS.ReceivePortName. I tried the ACK one, sent an email to emailBox1 and got the file in the correct folder but for mailBox2 I get a file with basically the same error message above in XML format, if I just use ReceivePortName I get an empty file and no error anywhere that I can find. 

    is my understanding correct here?

    1. BizTalk looks at a ReceiveLocation (POP3) gets the email
    2. Strips the attachment (per my orchestration
    3. Sends the file to each of the SendPorts
    4. Based on the filter in the SendPort, the Sendport will either send or not
    5. If no SendPort is found to accept the file then BizTalk throws the error
    6. Look at next ReceiveLocation.

    Thanks

    Thursday, September 17, 2009 5:53 PM
  • Hi Michael,

    Yes, your understanding is correct. BizTalk will throw subscription failure error whenever no subscribers are found for the messages received in MessageBox. In this case, if no send port is found with correct filter condition message will be suspended.

    You should be using the BTS.ReceivePortName instead of BTS.AckReceivePortName in filter.
    Genuine Basil
    Thursday, September 17, 2009 6:00 PM
  • I setup a catch-all SendPort, port with no filters. My file does not go there but I do get an emplty file for the mailBox2 SendPort . It appears that the filter on the SendPort for mailBox2 is working but maybe the file is just not there after being looked at by the SendPort for mailBox1? It acts like the file attachment gets dropped after being loked at by the first SendPort. I have the SendPorts defined at Static One-Way.

    Thanks
    Thursday, September 17, 2009 6:31 PM
  • Is there anythin special I need to do in my orchestration? Here is my flow

    1. receive email from receive port
    2. count number of attachments
    3. loop through each attachment
        3.1  build file name for file
        3.2  send file to send port
    4. end loop
    5. end orchestaration

    There is only 1 receive port and only 1 send port in the orchestration. So is what I am trying to do possible? Put multiple receive locations (1 per email box) and multiple send ports with a filter based on the receive port name in the application even do-able?

    Thanks

    Thursday, September 17, 2009 6:55 PM
  • First, let me see if I understand what you are trying to do.

    You want to receive messages with the BizTalk POP adapter and based on the To: field you want to strip the attachments and send them to multiple locations.

    To receive messages and get the To: field you need a custom pipeline that will promote POP3.To property so you can filter based on this field.
    Provided you can build this pipeline, you can either create multiple send ports with filter expressions based on POP3.To property, e.g., in each port you will specify:

    EmailMsg(POP3.To) = "Value1" AND
    EmailMsg(BTS.ReceivePortName) = "Your receive location"

    You only need one receive location in this case, the filter will take care of getting the To: lookup.

    Or, you can use one receive location, one dynamic send port and an orchestration.  You bind your ports to the orchestration, enlist and start (sorry if this is too trivial for some) and inside the orchestration you will have an expression shape with something like this:

    SendPort(Microsoft.XLANGs.BaseTypes.Address) = "your destination", which will be an expression based on EmailMsg(POP3.To).   The destination depends on the port type and, for a file adapter it is the destination file name, or the URL for HTTP or SOAP adapters etc.

    If, for any reason, you can determine how to process your message based on it's content, then you may not need the pipeline, just read the content of the message, determine where to send it and set up the address for the send port.

    Please let me know if this is helpful.
    Thursday, September 17, 2009 7:34 PM
  • Alex,

    You are somewhat there but I changed the filter on my send ports to look at the BTS.ReceivePortName. I have multiple receive locations (one per email box) and multiple receive ports (one per receive location). This setup seems to work ok as the emails from the email boxes are being picked up. I then created multiple send ports (one for each receive port) and set a filter for each (BTS.ReceivePortName == testemailbox1_receiveport). It appears that the filter is working ok as I am getting something to the output folder but the file it puts out is just empty. It appears that mailbox1_sendport is the only one that gets and can save the attachements. Does that make sense? I tried to setup a Send Port Group with the Send Ports in it, I then changed the application configuration for the orchestration to set the Outbound Logical Ports to the send port group that I created but that had the same effect (empty file when sending attachment to mailbox2).

    Does this help expalin it better?

    Thanks
    Thursday, September 17, 2009 8:01 PM
  • Michael, 

    Now I better understand what you are doing, thank you for the explanation.  Try this: for each receive location/send port pair, enable/start just these location and port, and disable/stop all others.  Then, pick up an email message and do this for each location/port pair.  So, only one receive location/send port are enabled/started at one time.  See if you get the attachments.  What I am looking for if this issue is specific to a specific port or, for any reason, if multiple receive locations are enabled at the same time, the attachment will only be saved for one location.  Sounds really strange, however, it is compatible with your observations.
    Thursday, September 17, 2009 8:36 PM
  • PS What do you get in the Context for the messages with blank attachments?
    Thursday, September 17, 2009 8:37 PM
  • Turning off receive locations/sed ports does not seem to do anything, I still do not get the file and I do not get any errors of any type. I did find out that if I righ click the application and select configure, click my orchestration and then change the inbound and outbound logical ports to mailbox2 entries it will work for mailbox2 but this breaks emailbox1. How do I get to the Context?
    Thursday, September 17, 2009 9:25 PM
  • Interesting.

    To get to the context, first fail your message by disabling the corresponding send port.  Then the message will be suspended and you will be able to find it in the BTS Admin console, under (naturally) Suspended Instances.  Run the query, right-click on the message, click Service Details, select Messages tab, double-click, select Context on the left.
    Thursday, September 17, 2009 9:35 PM
  • PS BTS Group under BTS Admin, disable the port, resend the message and expect "no subscriptions found" error message, then do all of the above.  Hope it makes sense.
    Thursday, September 17, 2009 9:37 PM
  • Let me start over since I have tried may things and am starting to get a big headache from looking at this all day.

    Can I create a single ReceivePort with multiple ReceiveLocations (1 for each mailbox). Create a Send Port for each mailbox and use a filter of BTS.InboundTransportLocation to show which file need to go out on the Send Port. When I look at the Contect the InboundTransportLocation show to be promoted.

    Thanks


    Thursday, September 17, 2009 9:55 PM
  • This sounds great.  Please let us know how it works.
    Thursday, September 17, 2009 9:57 PM
  • So i created 1 Receive Port with multiple Receive Locations, 1 for each mailbox. I then created a Send Port Group and added all the Send Ports for the different mailboxes and a catch-all Send Group. After that I change the configuration of the orchestration for the Receive Ports to point to the Receive Port I created and then changed the Send Ports/Send Port Groups to point to the Send Port Group that I created. I then added filters for each of the Send Ports for the BTS.InboundTransportLocation, 2 point to the emailboxes and the other one to the catch-all. I sent files to each of the email boxes and the files were written to all of the Send Ports, so it looks like it did not even look at the filters.

    I then removed the Seed Group and changed the orchestration Send Ports/Send Port Groups to one of the Send Ports. After this all my files went to my catch-all. So the filters are now working but are not matching anything. Somewhere in all this I did get an empty file to go where the real file should have gone but I cannot remeber how I did that one now.

    Well that is where I stand and I will be back in the morning to try again.

    It would be better if I had some training in BizTalk but oh well that's life in the technology world.

    Thanks for all the help.
    Thursday, September 17, 2009 10:53 PM
  • Sounds like you are on the right track and have the tools necessary to debug and resolve problems.  Please post if you have any other questions and mark any relevant submissions as "Answers".
    Thursday, September 17, 2009 11:03 PM
  • Well I kind of gave up on this approach as nothing I tries seemed to work. Either I got the file to go to all the send ports (by using a Send Port Group) or to only the send port that was defined in the orchestration configuration.

    Now my idea is to see if there is a way within the orchestration to send a variable to the send port for the location of the file. So now I have a whole group of other questions.

    1. Can I send a variable from the orchestration tht the send port can use in the file location field -->  %FileLocation%
    2. Can I set this file location within the orchestration by assigning the URL of the send port, send port defind as Specify now
    3. Any other options

    Thanks
    Friday, September 18, 2009 2:26 PM
  • Yes, use a dynamic send port.  Then, in the orchestration you specify

    SendPort(Microsoft.XLANGs.BaseTypes.Address) = "your destination" which is your file location.  Does this make sense?
    • Marked as answer by Michael Rhoades Friday, September 18, 2009 2:56 PM
    • Proposed as answer by Alex Krotov Friday, September 18, 2009 3:44 PM
    Friday, September 18, 2009 2:31 PM
  • Makes perfect sense. Now I just got setup a XML to pull my variable file locations from and hopefully all will be well.

    Thanks
    Friday, September 18, 2009 2:34 PM
  • Great.  Then, mark as answered if it was helpful.
    Friday, September 18, 2009 2:53 PM