Sending Messages / Events to Service Bus Entities using ServiceBus360

|  Posted: June 14, 2017  |  Categories: Messaging ServiceBus360

 ServiceBus360 is a SaaS platform providing efficient Management, Monitoring capabilities for Microsoft Azure Service Bus Namespaces. Please refer to “What is ServiceBus360” for a detailed overview. In this post, I’m going to share how you can leverage this tool to Send Events/Messages to Event Hubs/Queues/Topics along with other interesting features.

This feature is inspired by Service Bus Explorer – a tool to manage and test the entities contained in an Azure Service Bus namespace by Paolo Salvatori. It allows users to connect to a Service Bus namespace and manage entities very easily.

manage Service Bus namespace and entities

The reason we added this feature into our SaaS application is – a SaaS application can handle it better in terms of workload and reliability. Service Bus Explorer allows performing many similar actions but there’s a constraint of System Resources. Just for example – if you want to send messages for a long period, say 2 days, you must keep your machine running till the said duration and still, there might be chances of network outage which can break the sequence and you must start all of it again. The SaaS-based applications help you overcome these issues. Here, you can create a task to send messages to a queue or a topic or send events to an event hub right inside the browser and get off the screen anytime not worrying about the constraints of a Desktop Application. The sending of events or messages is processed in the cloud and hence there’s no need to keep your machine running or worry about the network outage or system hang-up etc. You can jump in anytime back and can see the status of a long running task. Let’s see how to send events/message using ServiceBus360.

Going further I assume that you have signed up with ServiceBus360 and have an account already.

You can send events/messages immediately from the list of event hubs/ queues or topics, or you can opt to create an Activity Configuration to schedule it for future. Activity Configuration has been introduced considering the re-usability.

We have a common “Activities” tab in both – Event Hubs and Messaging Namespaces – from here you can create Activity Configurations and initiate them, see the in-progress activities and their status.

What is an Activity?

Activities allow you to push sample messages into desired Queues and Topics. It can be used mainly for testing purposes. Ex: Sending 5000 sample messages into Queue or Topic with think time, batches, multiple threads etc. You can have multiple activities configured and executed them either instantaneously or via a schedule.

Sending Events to Event Hubs from the Event Hubs list

There’s an option button on the right side of every listed event hub inside selected event hub namespace. Click “Send Events” from the list of options – it will open a page to specify event details along with configuration. Mention the desired values and hit Send button. As every task is processed in the cloud – it will queue the task to a certain queue from where it will be picked up and processed. However, the processing is fast enough and you will be able to see the in-progress activity in “In Progress” tab. Sometimes you may not find an activity in “In Progress” tab if the number of events is too small. As the process is quick – the process might be completed momentarily.

How to Send Events to Event Hubs?

To send events instantly, use the “Send Events” option on the entity level:

send events option in event hubs

It will ask you to provide basic details and configuration. Click “Send” and it will initiate the activity to send events right away. If the activity has been configured to run for a while, say -more than a minute, you can see the activity running in “In Progress” tab under “Activities”. If It’s a couple of events only, it may be completed instantly.

sending messages to event hubs entities

Under “Activities”, we’ve got two tabs:

  • In-Progress Activities – shows all the activities which are in-progress now.
  • Activity Configuration – shows all the Activity Configurations.

event hubs activities in servicebus360

Creating an Activity Configuration

You can save a configuration for future use by creating an Activity Configuration. To create an Activity Configuration, click on “Activities” menu on the left and then click on “Create” in the upper right corner:

Creating an Activity Configuration in service bus

Activity configuration details which come in three pages. The first page covers the basic details (Activity Name, Event Message, and Custom Properties), the Second page covers the configuration- the number of events to send, think time between messages, batch size, task count and the number of events/messages you want to send.

There’s a checkbox on second configuration page – “Initiate Activity Immediately after you save”, which allows starting the activity as soon the activity configuration is saved.

The third allows you to configure an activity for the future run. If you want an activity to start not now but in future sometime – either recurring or one time only, this is the place where you configure that. For now – it allows only Daily Recurring but we have plans to make it hourly and minutely as well very soon. Here you can select how frequent you want it to run, every day or days of the week, or up to a certain number of executions. And then it will stop.

Configuration – page #1

event hubs activity configuration

Configuration – page #2

event hubs activity configuration

Configuration – page #3

event hubs activity configuration

As you save – it creates an activity configuration ready for you to re-use. The “play” button (in the image below) helps you initiating an activity of the Activity Configuration.

event hubs activity configuration

Activities in progress:

You can see all the activities in progress here, can check their configuration by clicking on the “info” icon” and, can delete an on-going activity.

event hubs activity configuration

In-Progress Activity Details:

Details of an in-progress activity can be viewed using the “info” icon on the right side.

event hubs activity configuration

Sending Messages to Queues/Topics from the list

Sending messages to a queue or topic is similar as sending events to an Event Hub. The Configuration of an activity is specific to the entity type.

Run Once: Initiating an activity from the saved activity configuration

You can initiate an activity for any Activity Configuration by clicking on “Run Once” button marked against every activity configuration “Activity Configurations” tab.

event hubs activity configuration

Cancelling an in-progress activity

You can cancel any activity-in-progress by clicking on the “Cancel” button on the right of every listed activity in “In-Progress” tab.

canceling an in-progress event hubs activity

The cancellation request will be queued and the activity will be cancelled in a couple of seconds.

All the completed activities are can be viewed in “Activity History” under “Governance & Auditing”.

Activity History

Activity completion status can be viewed by clicking in the info icon on the right of every record.

azure event hubs activity status

Successful Activity:

azure event hubs activity status

Cancelled Activity:

azure event hubs activity status

You can also filter the activities based on start & end date, entity type – event hubs / messaging and Namespace, in Activity History.

azure event hubs activity status

Watch our video on Sending Events to Event Hubs.

If you’re using Azure Service Bus namespace, I would recommend you ServiceBus360 as an efficient tool to manage, and monitor your entities. Very soon we’re going to introduce interesting Analytics features. Try it out and write to us your valuable feedback or suggestions at support@servicebus360.com.

Author: Sunny Sharma

Sunny Sharma works at BizTalk360 as a Senior Software Engineer. He is a Microsoft MVP – having 6 years of experience in development using Microsoft .NET technologies.

One Platform Operations, Monitoring and Analytics Software
BizTalk360

microsoft biztalk

Learn more

Over 500 customers across 30+ countries depend on BizTalk360

ServiceBus360

Azure Composite Applications

Learn more

Start managing your Azure services in minutes

One Platform - Operations, Monitoring and Analytics Software
BizTalk360

microsoft biztalk

Learn more

Over 500 customers across 30+ countries depend on BizTalk360

One Platform - Operations, Monitoring and Analytics Software
ServiceBus360

Azure Composite Applications

Learn more

Start managing your Azure services in minutes