locked
Send port filter on receive location name RRS feed

  • Question

  • Hi

    I have a situation where I need one receive port with two receive locations. Which is not a problem.

    E.g. ReceivePort 1 / ReceiveLocationA & ReceiveLocationB

    However I need to send all files that are received by ReceiveLocationB to a specific directory.

    Therefore i have created a send port with a filter on it. But there does'nt appear to be a filter for BTS.ReceiveLocationName. There is for ReceivePortName, but this would pick up files from both receive locations.

    Any help would be much appreciated.

     

    Monday, September 12, 2011 3:05 PM

Answers

  • The idea of having multiple receive locations in a receive port is to receive messages from multiple locations and treat them in the same way in BizTalk. But your requirement is to put the messages into separate directories. You can easily do this by using two receive ports and each having only one receive location. Now you can create  two send ports with filters set for corresponding receive ports via BTS.ReceivePortName. Hope this helps.
    Cheers,
    Bali
    MCTS: BizTalk Server 2010,BizTalk Server 2006 and WCF
    Blog: http://dpsbali-biztalkweblog.blogspot.com
    -----------------------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    • Marked as answer by MrPerks Monday, September 12, 2011 3:41 PM
    • Unmarked as answer by MrPerks Monday, September 12, 2011 3:42 PM
    • Marked as answer by MrPerks Monday, September 12, 2011 3:52 PM
    Monday, September 12, 2011 3:28 PM
  • Hi MrPerks,

    I would try setting the filter as  BTS.InboundTransportLocation == "C:\test\in\*.*"

    Let me know if doesnt work. Thanks !!

    • Proposed as answer by curious_mind Wednesday, September 14, 2011 1:35 PM
    • Marked as answer by MrPerks Thursday, September 15, 2011 10:14 AM
    Wednesday, September 14, 2011 4:45 AM

All replies

  • Off the top of my head, you could:

    • Create two receive ports with their own receive locations
    • If using different adapters, use adapter specific properties to identify
    • Promote a custom property and route on that

     


    If this is helpful or answers your question - please mark accordingly.
    Because I get points for it which gives my life purpose (also, it helps other people find answers quickly)
    Monday, September 12, 2011 3:13 PM
  • Hi,

    A solution is to create a custom pipeline component that writes and promotes properties. Jon Flanders has created a good generic component to do this: the ContextAdder Pipeline Component (downloable from his blog). You can through promoted property route it to send port. HTH

    Regards,

    Steef-Jan Wiggers
    MVP & MCTS BizTalk Server 2010
    http://soa-thoughts.blogspot.com/
    If this answers your question please mark it accordingly


    BizTalk
    Monday, September 12, 2011 3:17 PM
    Moderator
  • The idea of having multiple receive locations in a receive port is to receive messages from multiple locations and treat them in the same way in BizTalk. But your requirement is to put the messages into separate directories. You can easily do this by using two receive ports and each having only one receive location. Now you can create  two send ports with filters set for corresponding receive ports via BTS.ReceivePortName. Hope this helps.
    Cheers,
    Bali
    MCTS: BizTalk Server 2010,BizTalk Server 2006 and WCF
    Blog: http://dpsbali-biztalkweblog.blogspot.com
    -----------------------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    • Marked as answer by MrPerks Monday, September 12, 2011 3:41 PM
    • Unmarked as answer by MrPerks Monday, September 12, 2011 3:42 PM
    • Marked as answer by MrPerks Monday, September 12, 2011 3:52 PM
    Monday, September 12, 2011 3:28 PM
  • Hi

    Thanks for the quick replies. I have worked out a solution similar to what DPS Bali suggested.

     

    I will have two receive ports and three receive locations.

    So something like this.

    DirectoryA, DirectoryB

     

    Port1 will have two locations one for each directory. So anything in DirectoryA/B will be processed by the orchestration bound to Port1.

     

    Port2 will have a location for DirectoryB and a send port will then filter on this port.

     

    Hope that makes sense.

     

    Thanks for your help

    Monday, September 12, 2011 3:51 PM
  • Hi,

    Check this great post by Evan Aussenberg: How To Expose the BTS ReceiveLocationName Property


    Sandro Pereira Blog: http://sandroaspbiztalkblog.wordpress.com/ Please mark as answered if this answers your question.
    Monday, September 12, 2011 3:59 PM
    Moderator
  • Hello MrPerks,

    Why dont u you use the poperty BTS.InboundTransportLocation to route to different destinations based on receive location URI.

    Thanks!

    Monday, September 12, 2011 7:05 PM
  • Hi Sbharati

     

    I've just tried this. But nothing is being routed. Can you give me an example of the filter expression.

     

    Thanks

    Tuesday, September 13, 2011 12:09 PM
  • Hi MrPerks,

    I would try setting the filter as  BTS.InboundTransportLocation == "C:\test\in\*.*"

    Let me know if doesnt work. Thanks !!

    • Proposed as answer by curious_mind Wednesday, September 14, 2011 1:35 PM
    • Marked as answer by MrPerks Thursday, September 15, 2011 10:14 AM
    Wednesday, September 14, 2011 4:45 AM
  • MrPerks,

    BTS.InboundTransportLocation works. Remember to update this value in the bindings, if necessary, when you move the application between environments.


    SRG
    Wednesday, September 14, 2011 1:38 PM
  • Thanks for your help. This works fine.

     

    One note that maybe useful for others. The BTS.InboundTransportLocation name is Receive Folder + File mask, from the FILE transport Properties on the receive location.

     

    Thursday, September 15, 2011 10:19 AM