Skip to main content
Skip table of contents

Operation: Publish

The Publish operation publishes a message for a specific Apache Kafka topic that is specified in an XML input.

Input

The adapter expects a predefined XML structure as input. The structure depends on the data type of the message.

Data typeSTRING:

CODE
<Messages>
	<Message>
		<!-- This is a message. -->
	</Message>
	<Message>
		<!-- This is another message. -->
	</Message>
</Messages>

Data typeBYTES:

CODE
<Messages>
	<Message>ZXN0byBlcyB1biBmaWNoZXJvIGRlIHRleHRv</Message>
</Messages>

Data type NUMERIC:

CODE
<Messages>
	<Message>5428</Message>
</Messages>

Messages with and without headers can be mixed as desired:

CODE
<?xml version="1.0" encoding="UTF-8"?>
<Messages>
<!-- Example 1: A message with many headers -->
    <Message key="header-message">
        <Headers>
            <Header key="header1">value 1</Header>
            <Header key="header2">value 2</Header>
            <Header key="header3">value 3</Header>
        </Headers>
        <Body>Successfull message</Body>
    </Message>
<!-- Example 2: A message without headers but with message key -->
    <Message key="header-message">
        <Body>Successfull message</Body>
    </Message>
<!-- Example 3: A message without headers and message key -->
    <Message>
        <Body>Successfull message</Body>
    </Message>
</Messages>

Output

If execution is successful, the input is output.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.