Skip to content

Commit feb1328

Browse files
committed
Add config-metadata support to JMS, AQ & Kafka connectors #5227
Signed-off-by: Daniel Kec <[email protected]>
1 parent 0dd9315 commit feb1328

File tree

12 files changed

+283
-117
lines changed

12 files changed

+283
-117
lines changed

docs/src/main/asciidoc/mp/reactivemessaging/aq.adoc

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
///////////////////////////////////////////////////////////////////////////////
22

3-
Copyright (c) 2020, 2024 Oracle and/or its affiliates.
3+
Copyright (c) 2020, 2025 Oracle and/or its affiliates.
44

55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -51,32 +51,7 @@ include::{rootdir}/includes/dependencies.adoc[]
5151
5252
Connector name: `helidon-aq`
5353
54-
.Attributes
55-
|===
56-
|`datasource` | name of the datasource bean used to connect Oracle DB with AQ
57-
|`url` | jdbc connection string used to connect Oracle DB with AQ (forbidden when `datasource` is specified)
58-
|`username` | User name used to connect Oracle DB with AQ (forbidden when `datasource` is specified)
59-
|`password` | Password to connect Oracle DB with AQ (forbidden when `datasource` is specified)
60-
|`type` | Possible values are: `queue`, `topic`
61-
|`destination` | Queue or topic name
62-
|`acknowledge-mode` |Possible values are: `AUTO_ACKNOWLEDGE`- session automatically acknowledges a client’s receipt of a message,
63-
`CLIENT_ACKNOWLEDGE` - receipt of a message is acknowledged only when `Message.ack()` is called manually,
64-
`DUPS_OK_ACKNOWLEDGE` - session lazily acknowledges the delivery of messages. Default value: `AUTO_ACKNOWLEDGE`
65-
|`transacted` | Indicates whether the session will use a local transaction. Default value: `false`
66-
|`message-selector` | JMS API message selector expression based on a subset of the SQL92.
67-
Expression can only access headers and properties, not the payload.
68-
|`client-id` | Client identifier for JMS connection.
69-
|`durable` | True for creating durable consumer (only for topic). Default value: `false`
70-
|`subscriber-name` | Subscriber name for durable consumer used to identify subscription.
71-
|`non-local` | If true then any messages published to the topic using this session's connection,
72-
or any other connection with the same client identifier,
73-
will not be added to the durable subscription. Default value: `false`
74-
|`named-factory` | Select in case factory is injected as a named bean or configured with name.
75-
|`poll-timeout` | Timeout for polling for next message in every poll cycle in millis. Default value: `50`
76-
|`period-executions` | Period for executing poll cycles in millis. Default value: `100`
77-
|`session-group-id` | When multiple channels share same `session-group-id`,
78-
they share same JMS session and same JDBC connection as well.
79-
|===
54+
include::{rootdir}/config/io_helidon_messaging_connectors_aq_AqConfigBuilder.adoc[tag=config,leveloffset=+1]
8055
8156
=== Configured JMS Factory
8257

docs/src/main/asciidoc/mp/reactivemessaging/jms.adoc

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
///////////////////////////////////////////////////////////////////////////////
22

3-
Copyright (c) 2020, 2024 Oracle and/or its affiliates.
3+
Copyright (c) 2020, 2025 Oracle and/or its affiliates.
44

55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -52,30 +52,12 @@ include::{rootdir}/includes/dependencies.adoc[]
5252
5353
Connector name: `helidon-jms`
5454
55-
.Attributes
55+
include::{rootdir}/config/io_helidon_messaging_connectors_jms_JmsConfigBuilder.adoc[tag=config,leveloffset=+1]
56+
57+
TIP: Besides the configuration options above, custom attributes can be passed over configuration.
58+
59+
.Custom Attributes Examples
5660
|===
57-
|`username` | User name used to connect JMS session
58-
|`password` | Password to connect JMS session
59-
|`type` | Possible values are: `queue`, `topic`
60-
|`destination` | Queue or topic name
61-
|`acknowledge-mode` |Possible values are: `AUTO_ACKNOWLEDGE`- session automatically acknowledges a client's receipt of a message,
62-
`CLIENT_ACKNOWLEDGE` - receipt of a message is acknowledged only when `Message.ack()` is called manually,
63-
`DUPS_OK_ACKNOWLEDGE` - session lazily acknowledges the delivery of messages. Default value: `AUTO_ACKNOWLEDGE`
64-
|`transacted` | Indicates whether the session will use a local transaction. Default value: `false`
65-
|`message-selector` | JMS API message selector expression based on a subset of the SQL92.
66-
Expression can only access headers and properties, not the payload.
67-
|`client-id` | Client identifier for JMS connection.
68-
|`durable` | True for creating durable consumer (only for topic). Default value: `false`
69-
|`subscriber-name` | Subscriber name for durable consumer used to identify subscription.
70-
|`non-local` | If true then any messages published to the topic using this session's connection,
71-
or any other connection with the same client identifier,
72-
will not be added to the durable subscription. Default value: `false`
73-
|`named-factory` | Select in case factory is injected as a named bean or configured with name.
74-
|`poll-timeout` | Timeout for polling for next message in every poll cycle in millis. Default value: `50`
75-
|`period-executions` | Period for executing poll cycles in millis. Default value: `100`
76-
|`session-group-id` | When multiple channels share same `session-group-id`,
77-
they share same JMS session and same JDBC connection as well.
78-
|`jndi.jms-factory` | JNDI name of JMS factory.
7961
|`jndi.destination` | JNDI destination identifier.
8062
|`jndi.env-properties` | Environment properties used for creating initial context `java.naming.factory.initial`, `java.naming.provider.url` ...
8163
|`producer.someproperty` | property with producer prefix is set to producer instance (for example WLS Unit-of-Order `WLMessageProducer.setUnitOfOrder("unit-1")` can be configured as `producer.unit-of-order=unit-1`)

docs/src/main/asciidoc/mp/reactivemessaging/kafka.adoc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
///////////////////////////////////////////////////////////////////////////////
22

3-
Copyright (c) 2020, 2024 Oracle and/or its affiliates.
3+
Copyright (c) 2020, 2025 Oracle and/or its affiliates.
44

55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -29,7 +29,9 @@ include::{rootdir}/includes/mp.adoc[]
2929
3030
- <<Overview, Overview>>
3131
- <<Maven Coordinates, Maven Coordinates>>
32-
- <<Config Example, Config Example>>
32+
- <<Config, Config>>
33+
- <<Consuming Messages, Consuming Messages>>
34+
- <<Producing Messages, Producing Messages>>
3335
- <<NACK Strategy, NACK Strategy>>
3436
- <<Examples, Examples>>
3537
@@ -48,7 +50,7 @@ include::{rootdir}/includes/dependencies.adoc[]
4850
</dependency>
4951
----
5052
51-
== Config Example
53+
== Config
5254
5355
[source,yaml]
5456
.Example of connector config:
@@ -78,12 +80,19 @@ mp.messaging:
7880
<1> Kafka client consumer's property auto.offset.reset configuration for `from-kafka` channel only
7981
<2> Kafka client's property link:{kafka-client-base-url}#consumerconfigs_bootstrap.servers[bootstrap.servers] configuration for all channels using the connector
8082
83+
TIP: Besides the following configuration options, any property from https://kafka.apache.org/documentation/#consumerconfigs[consumer] or https://kafka.apache.org/documentation/#producerconfigs[producer] configuration can be passed to the underlying Kafka client.
84+
85+
include::{rootdir}/config/io_helidon_messaging_connectors_kafka_KafkaConfigBuilder.adoc[tag=config,leveloffset=+1]
86+
87+
== Consuming Messages
88+
8189
[source,java]
8290
.Example of consuming from Kafka:
8391
----
8492
include::{sourcedir}/mp/reactivemessaging/KafkaSnippets.java[tag=snippet_1, indent=0]
8593
----
8694
95+
== Producing Messages
8796
8897
[source,java]
8998
.Example of producing to Kafka:

messaging/connectors/aq/pom.xml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
-->
1818

1919
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
2121

2222
<modelVersion>4.0.0</modelVersion>
2323

@@ -69,6 +69,11 @@
6969
<groupId>jakarta.transaction</groupId>
7070
<artifactId>jakarta.transaction-api</artifactId>
7171
</dependency>
72+
<dependency>
73+
<groupId>io.helidon.config</groupId>
74+
<artifactId>helidon-config-metadata</artifactId>
75+
<optional>true</optional>
76+
</dependency>
7277
<dependency>
7378
<groupId>org.junit.jupiter</groupId>
7479
<artifactId>junit-jupiter-api</artifactId>
@@ -86,21 +91,52 @@
8691
</dependency>
8792
</dependencies>
8893

89-
9094
<build>
9195
<plugins>
9296
<plugin>
9397
<groupId>org.apache.maven.plugins</groupId>
9498
<artifactId>maven-compiler-plugin</artifactId>
9599
<configuration>
96100
<annotationProcessorPaths>
101+
<path>
102+
<groupId>io.helidon.codegen</groupId>
103+
<artifactId>helidon-codegen-apt</artifactId>
104+
<version>${helidon.version}</version>
105+
</path>
106+
<path>
107+
<groupId>io.helidon.config.metadata</groupId>
108+
<artifactId>helidon-config-metadata-codegen</artifactId>
109+
<version>${helidon.version}</version>
110+
</path>
111+
<path>
112+
<groupId>io.helidon.service</groupId>
113+
<artifactId>helidon-service-codegen</artifactId>
114+
<version>${helidon.version}</version>
115+
</path>
97116
<path>
98117
<groupId>io.helidon.common.features</groupId>
99118
<artifactId>helidon-common-features-codegen</artifactId>
100119
<version>${helidon.version}</version>
101120
</path>
102121
</annotationProcessorPaths>
103122
</configuration>
123+
<dependencies>
124+
<dependency>
125+
<groupId>io.helidon.codegen</groupId>
126+
<artifactId>helidon-codegen-apt</artifactId>
127+
<version>${helidon.version}</version>
128+
</dependency>
129+
<dependency>
130+
<groupId>io.helidon.config.metadata</groupId>
131+
<artifactId>helidon-config-metadata-codegen</artifactId>
132+
<version>${helidon.version}</version>
133+
</dependency>
134+
<dependency>
135+
<groupId>io.helidon.service</groupId>
136+
<artifactId>helidon-service-codegen</artifactId>
137+
<version>${helidon.version}</version>
138+
</dependency>
139+
</dependencies>
104140
</plugin>
105141
</plugins>
106142
</build>

0 commit comments

Comments
 (0)