Querying-BizTalk-Subscriptions-BizTalk360

Querying BizTalk Subscriptions in BizTalk360

Published on : Nov 5, 2019

Category : BizTalk360 Update

Senthil Kumar

Author

Introduction

The ability to query BizTalk Subscriptions is useful when you want to review how Orchestrations and Send Ports subscribe to messages etc. For example, when troubleshooting routing failures, you can review the existing subscriptions to see if any of them are improperly configured, thereby causing the routing failure. It is handy for the BizTalk users to view the publisher and subscriber when they troubleshoot or determine the use case.

Until now, BizTalk360 had all other queries (Message Box, Tracking Data and EDI), except Subscriptions. That feature is pending with respect to match the functionalities in BizTalk Admin Console. Based on customer feedback, we have implemented this feature in the upcoming release (9.0.3) of BizTalk360.

customer-feedback

Type of Subscriptions

Subscriptions are created by service classes in BizTalk Server, which is listed in the “adm_ServiceClass” table in the BizTalk Server Management database. These services include the caching service; in-process and isolated messaging, hosted by the Endpoint Manager; and orchestrations/XLANG hosted by the XLANG subservice. Each of these service classes can create subscriptions and receive published messages.

Subscribers use subscription in BizTalk to define the properties or criteria of the messages in which they are interested. A Subscription in BizTalk is like a filter or criteria or a condition that dictates BizTalk which message needs to be routed to which component or entity in BizTalk. There can be more than one subscriber to the same message. If that happens, each subscriber will get its own copy of the message.

In BizTalk Server, there are two subscription types are available. Both types are described below

Activation Subscription

An activation subscription specifies that when a message that fulfills the subscription, it should activate or create a new instance of the subscriber when such a message is received.

 Example: Activation subscriptions include send ports with filters or send ports that are bound to orchestrations, and orchestration’s receive shapes that have their Activate property set to true.

Instance Subscription

An instance subscription indicates that messages that fulfill the subscription should be routed to an already-running instance of the subscriber.

Example: Instance subscriptions are orchestrations instances with correlated receives and request/response-style receive ports waiting for a response from an external system.

Subscriptions Queries in BizTalk360

The Subscription query feature can be found under Operations-> Data Access-> Message Box Queries. As like the other MessageBox queries (Suspended Service Instances), subscriptions are fetched from the BizTalk Message Box database(s) with filters and Max Matches similar as in the BizTalk Admin Console.

Clicking the Execute Query button will fetch the subscription list with both activation and instance subscriptions. BizTalk360 has the capability to export the results in excel format. Users can manage the filters with saved query functionality.  

saved-queries

In the Subscription list view, there are three buttons are available to display the following

1. Subscription Details & Predicates

When navigating to the subscription details page, it will present detailed information about subscriptions and predicates. Subscription General tab will display Subscription Priority, Ordered Delivery, Creation Time, Subscription Type, etc.

subscription-details

Predicates: The Message Agent calls the bts_FindSubscriptions stored procedure held in the BizTalk Message Box to establish which subscriptions if any, match this message. This stored procedure queries the Subscription and Predicate SQL tables and joins them with the properties inserted for the batch of messages to identify potential subscribers.

Different Predicate SQL tables are used to match all the possible subscription expression combinations.

  • EqualsPredicates
  • ExistsPredicates
  • GreaterThanPredicates
  • GreaterThanOrEqualPredicates
  • GreaterThanPredicates
  • LessThanOrEqualPredicates
  • LessThanPredicates
  • NotEqualPredicates

subscription-expression

2. Service Properties

Clicking the Service properties button will provide the service instance details, error information and Message details, Message content and Message context properties.

service-properties

When subscribing, it is not possible to subscribe to any content of the actual messages entering BizTalk, but only to what information is stored in the Context of the message. The message metadata is called Context Properties; on receiving the message, the Adapter, Pipeline, and Map will possibly add information to the Context.

Context Properties can either be Promoted or Not promoted. Properties that are promoted can be used for subscribing to the message. However, Not promoted properties cannot be used for subscribing to the message.

message-properties

3. Messages

When you click on the Message icon, it will populate the Messages query with Service Instance ID and Host Name related to the subscriptions.

Subscription processing is complex, so in short, you just need to remember that once a message arrives at the Message Agent, subscribers are evaluated, the message is inserted, and references are then added into the host instance queue, ready for processing by the subscriber hosted by the host instance.

query-expression

User Access Policy

When users are having the permissions for Message Box Queries, they are also able to access the Subscriptions. To view the Messages and Content, the user should have permission to view the Message Content/Context in the user access policy.

data-access

When the user does not have the privilege to view Message Content/Context, they will be restricted to view Message Content/Context from the Subscriptions List.

query-box

Note: Subscriptions are only implemented in the BizTalk360 Operations section. Subscriptions are not implemented in Data Monitoring as it is not applicable for the feature.

 Conclusion

We are constantly improving on the features based on feedback in the customer forum. BizTalk360 will continue to provide more useful features in every release. Why not give BizTalk360 a try! It takes about 10 minutes to install on your BizTalk environments and you can witness and check the security and productivity of your own BizTalk environments.