Wednesday, August 24, 2011 6:24 PM
I am trying to filter a message on a send port by FILE.ReceivedFileName, but I keep getting a no subscribers error. I have tried using just the file name and the full name with the path.
- Changed Type Steef-Jan WiggersMVP, Moderator Friday, August 26, 2011 6:18 AM Question not discussion
Wednesday, August 24, 2011 6:32 PM
File.ReceivedFileName is in the message context and is not promoted. You cannot use that in the Filter. To achieve this you will have to write a custom pipeline which will promote the property for you to use.
Mark As Answer or Vote As Helpful if this helps.
- Marked As Answer by Brad1981 Monday, August 29, 2011 8:13 PM
Friday, August 26, 2011 6:17 AM
Since I am a BizTalk Administrator and not developer, what I would do if there is a special file i need to pick up by the filename (lets say this is an application without an Orchestration)
1. You can simple create a new receive port and receive location, that only picks up the file you need.
2. Create a new send port this send port
3. Set a filter on the sendport -> BTS.ReceivePortName and keep the operator as == and add the name of your receive port.
In this scenario it will only pick up messages that came through the receive locations located under the receive port.
But if this is a more complex application I would rather suggest you to create this as an application with orchestration, then you can in the Orchestration set it to send it to the correct send port if the name of the file is "fileSpecial.xml" and the rest to the other send port., instead of using filters.
Friday, August 26, 2011 6:18 AMModerator
One of the most interesting thing about Context Properties is that are not tied to a concrete schema, so they can be used regardless the message type. A sample of a system context property is FILE.ReceivedFilename. When you create a context property, not based on a message field, and you assign a value inside an orchestration, it is written, but not promoted. What does it means? it means that you cannot route the message based on this property. A common 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).
MVP & MCTS BizTalk Server 2010
If this answers your question please mark it accordingly
Friday, August 26, 2011 6:54 AM
You are getting no subscribers error because FILE.ReceivedFile name context property of the message is not promoted. As the default XML receive pipeline doesn't promote this context property, you have to write a custom pipeline component to promote this.
Abhijit Mahato - Microsoft Community Contributor 2011 - MCTS BizTalk Server blog: http://abhijitmahato.wordpress.com/ Please "Mark as Answer" if Post has Answered the Question
Friday, August 26, 2011 7:36 AM
On a side note, you can promote properties from an orchestration by having a corroleation set initialized on a send port. There would be no following correlation set but as long as there is a subscriber to the message somewhere (another orchestration or a send port), I guess that it would be ok.