Real-Time Service Bus: How the Minecraft Bot Reacts Instantly

When someone creates a production order in Dynamics 365, how fast does the Minecraft bot react?

Answer: Instantly. No polling. No delays. Just push.

The Problem with Polling

Most systems check for new work every few seconds:

Bot asks server: “Any new orders?”

Server says: “Nope.”

Bot waits 5 seconds.

Bot asks again: “Any new orders?”

Server says: “Nope.”

Bot waits 5 seconds.

Bot asks again: “Any new orders?”

Server says: “Finally yes, here’s one from 10 seconds ago.”

Slow. Wasteful. Annoying.

Our Solution: Service Bus Push

Order created in D365

   ↓

Azure Service Bus receives event

   ↓

ASB Listener gets notified INSTANTLY

   ↓

Backend API processes and forwards to bot

   ↓

Bot starts working in under 1 second

No waiting. No polling. The moment an event hits the queue, our listener knows about it.

How It Works

We built a dedicated ASB Listener service using TypeScript and the Azure Service Bus SDK. It sits there with an open subscription to the queue.

The listener uses ServiceBusClient to connect to Azure, creates a ServiceBusReceiver that subscribes to the queue with peekLock mode, and processes messages the instant they arrive.

receiver.subscribe({

  processMessage: async (message) => {

    await forwardToBackend(message.body);

  }

});

When a message arrives, the listener parses the order data, forwards it to the backend API via HTTP, and the backend triggers the Minecraft bot. All of this happens in real time.

Why Service Bus

We could have used HTTP webhooks, but Service Bus gives us guaranteed delivery, built-in retry and dead-letter queues, auto-scaling, decoupling between producer and consumer, and native Azure integration.

The flow is clean:

Production Order → Service Bus Queue → ASB Listener → Backend API → Minecraft Bot

No database polling. No scheduled jobs. Just pure event-driven architecture.

____

Cepheo Crafting Creepers