Message Hub (Event Streams) Toolkit > com.ibm.streamsx.messagehub 3.3.1 > com.ibm.streamsx.messagehub > Types.spl
Defines Message types with default attribute names and types.
This type represents a message with message attribute of type blob and key attribute with SPL type rstring. The type can be used for consumed messages or messages to be produced.
Example use:
// messages get de-serialized into blob stream <MessageType.BlobMessage> ReceivedMessages = MessageHubConsumer() { param topic: "myTopic"; groupId: "consumerGroup1"; }
This type represents the meta data of a received message.
Example Use:
stream <MessageType.BlobMessage, MessageType.ConsumerMessageMetadata> ReceivedMessages = MessageHubConsumer() { param topic: "myTopic"; groupId: "consumerGroup1"; }
This type represents a message with message and key attribute, both being rstring. The type can be used for consumed messages and messages to be produced.
// messages get de-serialized into rstring stream <MessageType.StringMessage> ReceivedMessages = MessageHubConsumer() { param topic: "myTopic"; groupId: "consumerGroup1"; }
This type represents a topic and a partition number. It can be used to store meta data of received messages and to specify the topic and partition number of messages to be published (produced).
Defines types for the JSON generator functions for the control port.
Tuple type for a topic partition to be added or removed
Example Use:
mutable list <Control.TopicPartition> partitionsToAdd = []; appendM (partitionsToAdd, {topic = 'topic1', partition = 0}); appendM (partitionsToAdd, {topic = 'topic1', partition = 1}); submit ({controlMsg = createMessageAddTopicPartition (partitionsToAdd)}, ControlMessages);
Tuple type for a topic partition with offset to be added
Example Use:
mutable list <Control.TopicPartitionOffset> partitionsWithOffsetsToAdd = []; appendM (partitionsWithOffsetsToAdd, {topic = 'topic1', partition = 0, offset = -2l}); appendM (partitionsWithOffsetsToAdd, {topic = 'topic1', partition = 1, offset = 345678l}); submit ({controlMsg = createMessageAddTopicPartition (partitionsWithOffsetsToAdd)}, ControlMessages);