-
Notifications
You must be signed in to change notification settings - Fork 31
InboundMessageChannel
The Inbound Message Channel is a specialized Jetstream Inbound Channel implementation that builds on top of Jetstream Cluster messaging. It enables event streams to be consumed from Jetstream Pub-Sub messaging Topics and processed in Jetstream Applications. The Inbound Channel is a dumb recipient of messages. The Inbound Message Channel layers on top of the Jetstream Messaging Service. It subscribes to the provisioned topics and consumes Jetstream Event Streams and forwards it to its sinks for downstream processing.
There is no software development required to use this channel. All that is needed is to provide the bean specification for the channel and its supporting beans to the Jetstream Container.
This section shows you how to provision an Inbound Message Channel in Spring XML. There are 3 beans that need to be provisioned for an InboundMessagingChannel to operate correctly viz. ChannelBinding, InboundChannel and ChannelAddress.
A channel binder is a container of the channel and performs lifecycle management and flow control for channels
<bean id="InboundMessageBinder" scope="singleton"
class="com.ebay.jetstream.event.support.channel.ChannelBinding"
depends-on="MessageService">
<property name="channel" ref="InboundMessages" />
</bean><bean id="InboundMessages"
class="com.ebay.jetstream.event.channel.messaging.InboundMessagingChannel">
<property name="address" ref="InboundChannelAddress" />
<property name="alertListener" ref="componentStatusHarvester" />
<property name="eventSinks">
<list>
<ref bean="RateLimiter" />
</list>
</property>
</bean>This bean takes a reference to an address bean containing all the topics for subscription, if an alert listener bean is optionally injected it can generate alerts and send it to the alert listener.
The list of event sinks receiving events from InboundMessageChannel is specified by the "eventSinks" property. Provision this list to suit your wiring.
This is where you specify a list of Jetstream Messaging topics that this channel subscribes to.
<bean id="InboundChannelAddress"
class="com.ebay.jetstream.event.channel.messaging.MessagingChannelAddress">
<property name="channelTopics">
<list>
<value>Jetstream.demo/rawEvent</value>
</list>
</property>
</bean>The Topic name is made up of a root context. In this example the root context is "Jetstream.demo". This root context must be bound to a netty transport instance and needs to be provisioned in the MessageServiceProperties bean.
The Inbound Channel layers on top of the Jetstream Message Service. This service needs to be provisioned.The topics provisioned for the Inbound Message Channel as Channel addresses have a root context. E.g for the topic "Jetstream.demo/rawEvent", "Jetstream.demo" is the root context. This root context must be bound to a netty transport instance in MessageServiceProperties bean.