Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Message Channel

Kafka message channels for async processing in Ecotone

To understand the use case behind Message Channels read Asynchronous Processing section for Application level processing and Distributed Bus section for cross application communication.

Message Channel

To create Kafka Backed Message Channel, we need to create Service Context.

class MessagingConfiguration
{
    #[ServiceContext] 
    public function orderChannel()
    {
        return KafkaMessageChannelBuilder::create("orders");
    }
}

Now orders channel will be available in our Messaging System.

High Throughput Publishing (Enterprise)

Messages published within the same execution scope can be pipelined to the Broker with deferred delivery reports, multiplying publishing throughput:

#[ServiceContext] 
public function orderChannel()
{
    return KafkaMessageChannelBuilder::create("orders")
        ->withHighThroughputPublishing();
}

Both mechanisms can be tuned individually with batchPublishing, nonBlockingConfirmation and confirmationTimeoutInMilliseconds.

Customize Topic Name

By default the queue name will follow channel name, which in above example will be "orders". However we can use "orders" as reference name in our Application, yet name queue differently:

Customize Group Id

We can also customize the group id, which by default following channel name:

Final Failure Strategy

Last updated

Was this helpful?