Jakarta EE Plugin
Overview
The Jakarta EE plugin connects QALIPSIS to a messaging platform that supports JAKARTA EE Messaging.
- Technology addressed
-
Jakarta EE Messaging and the products compliant with it.
- Dependency
-
io.qalipsis.plugin:qalipsis-plugin-jakarta-ee-messaging - Namespace in scenario
-
` .jakarta()`
- Client library
-
Refer to Jarkata EE.
- Supported steps
Example scenarios using a combination of Jakarta EE supported steps are provided on Github.
Consume step
The consume step within the Jakarta EE plugin consumes records from a Jakarta-EE-Messaging-compatible product.
- Ancestor
-
Scenario
- Functionality
-
The
consumestep polls data from the designated connection, step context, and the data deserializer. - Example
-
it.jakarta().consume { queues("battery_state") queueConnection { ActiveMQConnectionFactory( "tcp://localhost:61616", "qalipsis_user", "qalipsis_password" ).createQueueConnection() } } .deserialize(JakartaJsonDeserializer(targetClass = BatteryState::class)) .map { result -> result.record.value } - Notable parameters
-
-
queues: specifies the queue(s) to consume. -
QueueConnection: provides the connection to attach to the queue consumer, which is generally specific to the underlying product. -
topics(optional): specifies the topic(s) to consume. -
topicConnection(optional): provides the connection to attach to the topic consumer, which is generally specific to the underlying product. -
broadcast(optional): specifies the broadcast parameters for the step. -
deserialize: specifies the class to use to deserialize the body of the response. -
session(optional): allows to configure the session to attach to the message producer, see the official documentation of Jakarta EE Messaging for more explanation.
-
- Tip
-
The connection can be configured to consume either
queues(queueConnection) ortopics(topicConnection), but not both. - Reference documentation
-
Refer to the Jakarta EE documentation for further parameter and configuration information.
Produce step
The produce step within the Jakarta EE plugin produces records in a Jakarta-EE-Messaging-compatible product.
- Ancestor
-
Step
- Functionality
-
The
producestep within the Jakarta EE plugin produces records in a Jakarta-EE-Messaging-compatible product. - Example
-
.jakarta() .produce { connect { ActiveMQConnectionFactory( "tcp://localhost:61616", "qalipsis_user", "qalipsis_password" ).createQueueConnection() } session { it.createSession(false, Session.AUTO_ACKNOWLEDGE) } records { _, input -> listOf( JakartaProducerRecord( destination = Queue("battery_state"), messageType = JakartaMessageType.BYTES, value = objectMapper.writeValueAsBytes(input) ) ) } } - Notable parameters
-
-
connect: provides the connection for theJakartaProducerRecord(s). -
records: generates a list of records to send the messaging platform.-
destination: defines the destination for eachJakartaProducerRecordas either queues (QueueConnection) or topics (TopicConnection). -
messageType: indicates theJakartaMessageTypeas:TEXT,AUTO,BYTES, orOBJECT. -
value: defines the message to be displayed at thedestination.
-
-
session(optional): allows to configure the session to attach to the message producer, see the official documentation of Jakarta EE Messaging for more explanation. -
producers(optional, default to 1): number of producers to use, in order to scale the data production up.
-
- Tip
-
If you are not sure about the
JakartaMessageType, useAUTOto allow the system to infer the type and display the result. - Reference documentation
-
Refer to the Jakarta EE documentation for further parameter and configuration information.