ASB Producer

In this article

Overview

ASB Producer is a Write-type Snap that allows you to send messages to a queue in Azure Service Bus (ASB).

Prerequisites

  • A valid Azure Service Bus account.

  • Valid Namespace and SharedAccessKey in Azure Service Bus.

Support for Ultra Pipelines  

Works in Ultra Pipelines

Limitations and Known Issues

None.

Snap Views

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Input 

Document

 

  • Min: 0

  • Max: 1

  • Mapper Snap

  • Copy Snap

  • Sequence Snap

A key-value pair for the message.

Output

Document

  • Min: 0

  • Max: 1

  • None

The Consumer Snap is decoupled from the Producer Snap.

Message records. 

Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter while running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:

  • Stop Pipeline Execution: Stops the current pipeline execution when the Snap encounters an error.

  • Discard Error Data and Continue: Ignores the error, discards that record, and continues with the rest of the records.

  • Route Error Data to Error View: Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap Settings

  • Asterisk (*): Indicates a mandatory field.

  • Suggestion icon ( ): Indicates a list that is dynamically populated based on the configuration.

  • Expression icon (): Indicates whether the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.

  • Add icon ( ): Indicates that you can add fields in the field set.

  • Remove icon (): Indicates that you can remove fields from the field set.

Field Name

Field Type

Field Dependency

Description

Field Name

Field Type

Field Dependency

Description

Label*

String

N/A

Specify a unique name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your Pipeline.

Default ValueASB Producer
ExampleASB Producer

Destination Type

Dropdown list

Enables Queue and Topic fields.

Choose an option where the messages should be sent. Available options are:

  • QUEUE: Messages are sent to the queue.

  • TOPIC: Messages are sent to the topic.

Queue

String/Expression

Enabled on selecting QUEUE for Destination Type.

Specify the name of the queue to which the message should be added. Alternatively, click the Suggestion icon to get the list of Queues corresponding to the Azure Service Bus account and select a Queue.

Default Value: N/A
Example: 25queue

Topic

String/Expression

Enabled on selecting TOPIC for Destination Type.

Specify the topic to which the message should be published or subscribed. Alternatively, click the Suggestion icon to fetch the list of Topics corresponding to the Azure Service Bus account and select a Topic.

Default Value: N/A
Example: XYZ

Message value

String/Expression

N/A

Specify the message value (content of the message) to send.

Default Value: N/A
Example$msg

Content Type

Dropdown list

N/A

Choose the content type for the message:

  • PLAIN_TEXT

  • APPLICATION_JSON

  • APPLICATION_XML

Default Value: APPLICATION_JSON
Example: PLAIN_TEXT

You can overwrite the content type chosen here by providing advanced properties.

Message Properties

 

Use this field set to define message properties. This field set contains the following fields:

  • Properties

  • Values

Properties

Dropdown list

N/A

Choose the type of the message property to route messages to particular destinations. Available options are:

  • Message ID: The ID of the message that you want the Snap to write in ASB.

  • Subject: The subject of the message.

  • Correlation ID: A context for the message for the purpose of correlation, for example reflecting the Message ID of a message that is being replied to.

  • Content Type: Gets or sets the content type. The content type can be of three types: XML, JSON, and Plain Text.

  • Schedule Enqueue Time: The scheduled enqueue time in UTC, which is similar to Schedule Message Date. It also accepts the OffsetDateTime, (2022-01-11T12:30:00+05:30)
    yyyy-MM-ddTHH:mm:ss[+/-]xx:xx

  • Time to Live: The time to live in seconds for a message, for example PT20S - stands for 20 seconds, after 20 seconds the message is deleted from the queue.

  • Partition Key: Partition Key is used when the queue is partition enabled. You can enable partitioning while creating the queue. Partitioning allows you to store similar kind of data in partitions using partition keys in the ASB. You need to create a queue with partitioning enabled and provide a Partition Key.

  • Reply To: The address of an entity to send replies to. Specify a reply path to the receiver of the message. When a sender expects a reply, it sets the value to the absolute or relative path of the queue or topic it expects the reply to be sent to, for example testQueue4.

  • To: Specify the next entity path for the message, for example testqueue4.

Default ValueMessage ID
Example: Subject

Values

String/Expression

N/A

Specify the value of the message property.

Default Value: N/A
Example: 630

Custom Properties

Use this field set to provide custom properties in key-value pairs. Click to add key-value pairs. Enter each pair in a separate row.

  • Key

  • Values

Key

String/Expression

N/A

Specify the key for the custom property.

Default Value: N/A
Example: keyProp

Values

String/Expression

N/A

Specify a value for the key.

Default Value: N/A
Example: valueProp

Max Batch Size (in bytes)

Integer

N/A

Specify the maximum size (in bytes) of a batch of messages to process.
Maximum: 256kb for standard tier and 1MB for premium tier.

Default Value-1
Example5

Schedule Message Date (yyyy-MM-ddTHH:mm:ss[+/-]xx:xx)

String/Expression

N/A

Specify the time and date at which the message should be sent to ASB. The time and date format must be in OFFSET_DATE_TIME format (2021-12-22T20:00:00-08:00), as Azure Service Bus supports the OffsetDateTime format only.

Default Value: N/A
Example: 2021-12-22T20:00:00-08:00

Snap Execution

Dropdown list

N/A

Select one of the three modes in which the Snap executes. Available options are:

  • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during Pipeline runtime.

  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.

  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default ValueExecute only
ExampleValidate & Execute

Examples

Sending Messages to a Queue

This example Pipeline demonstrates how to send messages to a queue in Azure Service Bus.

First, configure the Sequence Snap to specify the number of documents to write in the stream.

Next, configure the ASB Producer Snap as follows to write messages to a queue.

After validating the Pipeline, the ASB Producer Snap writes the messages to the queue. You can view the status of the messages sent in the output preview as follows.

Download this Pipeline

Sending Message to a Topic

This example Pipeline demonstrates how to write messages to a topic. First, configure the ASB Producer Snap as follows.

After validating the Pipeline, the Snap writes the messages to the specified topic. You can view the status of the messages sent in the output preview.

Download this Pipeline

Sending Messages as per the Schedule

This example Pipeline demonstrates how to schedule a time and date to send messages in ASB. To do so, configure the ASB Producer Snap with the time and date when the message should be sent as follows.

After validating the Pipeline, the Snap sends the message in ASB according to the specified schedule.

Download this Pipeline.

Downloads

 

  File Modified

File Example1_ASB Producer.slp

Dec 01, 2021 by Kalpana Malladi

File Example2_ASB_Producer.slp

Dec 01, 2021 by Kalpana Malladi

File Example3_ASB Producer.slp

Dec 01, 2021 by Kalpana Malladi

Snap Pack History

 


Related Content