Skip to main content
Version: Next

ActiveMQ

ActiveMQ sink connector

Description

Write SeaTunnel rows to an ActiveMQ queue. Each row is serialized as a JSON text message. This is a sink-only connector; SeaTunnel does not provide an ActiveMQ source connector.

Key features

Options

nametyperequireddefault valuedescription
uristringyes-ActiveMQ broker URL, such as tcp://localhost:61616.
queue_namestringyes-Queue name to write messages to.
usernamestringno-Username used to create the ActiveMQ connection. If this option is set, password must also be set.
passwordstringno-Password used to create the ActiveMQ connection. If this option is set, username must also be set.
client_idstringno-JMS client ID used by the connection factory.
check_for_duplicatebooleanno-Whether the ActiveMQ client checks duplicate messages.
always_session_asyncbooleanno-Whether the ActiveMQ client always uses a separate thread to dispatch messages for each session.
always_sync_sendbooleanno-Whether the ActiveMQ producer always uses synchronous sends.
close_timeoutintno-Timeout in milliseconds before closing the connection is considered failed.
dispatch_asyncbooleanno-Whether the broker dispatches messages asynchronously.
nested_map_and_list_enabledbooleanno-Whether structured message properties and MapMessage entries can contain nested Map and List objects.
warn_about_unstarted_connection_timeoutintno-Timeout in milliseconds before ActiveMQ warns that a connection was not started correctly. Set a value less than 0 to disable the warning in the ActiveMQ client.

Notes

  • uri is the connection entry point. Put the broker host and port in this value, for example tcp://activemq-host:61616.
  • username and password are optional, but they must be configured together when the broker requires authentication.
  • The connector writes each SeaTunnel row as one JSON text message to queue_name. There is no separate format option for this sink.
  • Configure the broker address with uri. host and port are not ActiveMQ sink options.
  • Use any SeaTunnel source before this sink. The ActiveMQ connector only controls how the final rows are sent to the queue.

Example

Write fake data to an ActiveMQ queue:

env {
parallelism = 1
job.mode = "BATCH"
}

source {
FakeSource {
schema = {
fields {
id = int
name = string
}
}
rows = [
{ kind = INSERT, fields = [1, "Alice"] }
{ kind = INSERT, fields = [2, "Bob"] }
]
}
}

sink {
ActiveMQ {
uri = "tcp://localhost:61616"
username = "admin"
password = "admin"
queue_name = "testQueue"
}
}

Changelog

Change Log
ChangeCommitVersion
[Improve][connector][activemq] Remove duplicate dependencies (#8753)https://github.com/apache/seatunnel/commit/da6241aa1c2.3.10
[improve] update activemq connector config option (#8580)https://github.com/apache/seatunnel/commit/629f85b23a2.3.10
[Improve][dist]add shade check rule (#8136)https://github.com/apache/seatunnel/commit/51ef8000162.3.9
[Feature][Restapi] Allow metrics information to be associated to logical plan nodes (#7786)https://github.com/apache/seatunnel/commit/6b7c53d03c2.3.9
Bump org.apache.activemq:activemq-client (#7323)https://github.com/apache/seatunnel/commit/e23e3ac4ed2.3.7
[Feature][Activemq] Added activemq sink (#7251)https://github.com/apache/seatunnel/commit/f0cefbeb4a2.3.7