mp.reactivemessaging.weblogic.adoc Maven / Gradle / Ivy
///////////////////////////////////////////////////////////////////////////////
Copyright (c) 2022, 2024 Oracle and/or its affiliates.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
///////////////////////////////////////////////////////////////////////////////
= WebLogic JMS Connector
:description: Reactive Messaging support for WebLogic JMS in Helidon MP
:keywords: helidon, mp, messaging, jms, WebLogic, wls, thin
:feature-name: WebLogic JMS connector
:microprofile-bundle: false
:rootdir: {docdir}/../..
include::{rootdir}/includes/mp.adoc[]
:jakarta-version: Jakarta EE {version-lib-jakarta-ee}
== Contents
- <>
- <>
- <>
- <>
== Overview
WebLogic JMS Connector extends Helidon JMS connector with special handling for legacy WebLogic T3 thin clients.
Legacy versions of thin client can be found in server/lib directory(`WL_HOME/server/lib/wlthint3client.jar`) of any WebLogic Server installation.
Helidon supports {jakarta-version}. Legacy versions of `javax` based thin T3 client will not work correctly when added to the classpath.
Legacy thin T3 clients must be loaded from a filesystem location specified by the `thin-jar` property.
WARNING: Do not place legacy `wlthint3client.jar` on the Helidon classpath. The client library location needs to be
configured and loaded by the Helidon messaging connector.
WARNING: When using the legacy WebLogic T3 thin clients, make sure to start the Helidon application with `--add-opens=java.base/java.io=ALL-UNNAMED` to allow reflection with the legacy wlthint3client.
Updated versions of thin T3 clients that are compatible with modern Jakarta runtimes can be downloaded from {osdc-link} as `wlthint3client.jakarta`. However, Jakarta based thin clients can be placed on the Helidon classpath and used with this specialized connector or
the xref:../../mp/reactivemessaging/jms.adoc[JMS connector]
After the download, the thin T3 client artefact needs to be installed in the Maven repository accessible from the application build.
include::{rootdir}/includes/dependencies.adoc[]
[source,xml]
----
io.helidon.messaging.wls-jms
helidon-messaging-wls-jms
----
== Configuration
Connector name: `helidon-weblogic-jms`
.Attributes
|===
|`jms-factory` | The JNDI name of the JMS factory configured in WebLogic.
|`url` | t3, t3s, or http address of WebLogic Server.
|`thin-jar` | Filepath to the WebLogic thin T3 client jar (`wlthint3client.jar`); this path can be usually found within the WebLogic Server installation.
`WL_HOME/server/lib/wlthint3client.jar`
|`principal` | The WebLogic initial context principal (user).
|`credentials` | The WebLogic initial context credential (password)
|`type` | The possible values are: `queue`, `topic`. Default value is: `topic`
|`destination` |The queue or topic name in WebLogic CDI (Create Destination Identifier) Syntax.
|`jndi.destination` | JNDI destination identifier. When no such JNDI destination is found, falls back to `destination` with CDI syntax.
|`acknowledge-mode` | The possible values are: `AUTO_ACKNOWLEDGE`- session automatically acknowledges a client’s receipt of a message,
`CLIENT_ACKNOWLEDGE` - receipt of a message is acknowledged only when `Message.ack()` is called manually,
`DUPS_OK_ACKNOWLEDGE` - session lazily acknowledges the delivery of messages. Default value: `AUTO_ACKNOWLEDGE`
|`transacted` | Indicates whether the session will use a local transaction. Default value: `false`
|`message-selector` | The JMS API message selector expression based on a subset of the SQL92. Expression can access only headers and properties, not the payload.
|`client-id` | The client identifier for JMS connection.
|`durable` | True for creating durable consumer (only for topic). Default value: `false`
|`subscriber-name` | The subscriber name for the durable consumer used to identify subscription.
|`non-local` | If `true` then any message that is published to the topic using this session's connection or any other connection with the same client identifier, will not be added to the durable subscription. Default value: `false`
|`named-factory` | Select in case factory is injected as a named bean or configured with name.
|`poll-timeout` | The timeout interval (in millis) for polling for the next message in every poll cycle. Default value: `50`
|`period-executions` | The period for executing poll cycles in millis. Default value: `100`
|`session-group-id` | When multiple channels share the same `session-group-id`, they also share the same JMS session and JDBC connection.
|`producer.unit-of-order` | All messages from the same unit of order will be processed sequentially in the order they were created.
|===
Configuration is straight forward. Use JNDI for localizing and configuring of JMS ConnectionFactory from WebLogic. Notice the destination property which is used to define the queue with
https://docs.oracle.com/cd/E24329_01/web.1211/e24387/lookup.htm#JMSPG915[WebLogic CDI Syntax].
[source,yaml]
.Example config:
----
mp:
messaging:
connector:
helidon-weblogic-jms:
# JMS factory configured in WebLogic
jms-factory: jms/TestConnectionFactory
# Path to the WLS Thin T3 client jar
thin-jar: wlthint3client.jar
url: t3://localhost:7001
incoming:
from-wls:
connector: helidon-weblogic-jms
# WebLogic CDI Syntax(CDI stands for Create Destination Identifier)
destination: ./TestJMSModule!TestQueue
outgoing:
to-wls:
connector: helidon-weblogic-jms
# JNDI identifier for the same queue
jndi.destination: jms/TestQueue
----
When configuring destination with WebLogic CDI, apply the following syntax:
.Non-Distributed Destinations
`jms-server-name/jms-module-name!destination-name`
In our example, we are replacing jms-server-name with `.` as we don’t have to look up the server we are connected to.
.Uniform Distributed Destinations (UDDs)
`jms-server-name/jms-module-name!jms-server-name@udd-name`
Destination for UDD doesn't have `./` prefix, because distributed destinations can be served by multiple servers within a cluster.
== Usage
=== Consuming
[source,java]
.Consuming one by one unwrapped value:
----
include::{sourcedir}/mp/reactivemessaging/WeblogicSnippets.java[tag=snippet_1, indent=0]
----
[source,java]
.Consuming one by one, manual ack:
----
include::{sourcedir}/mp/reactivemessaging/WeblogicSnippets.java[tag=snippet_2, indent=0]
----
=== Producing
[source,java]
.Producing to WebLogic JMS:
----
include::{sourcedir}/mp/reactivemessaging/WeblogicSnippets.java[tag=snippet_3, indent=0]
----
[source,java]
.Example of more advanced producing to WebLogic JMS:
----
include::{sourcedir}/mp/reactivemessaging/WeblogicSnippets.java[tag=snippet_4, indent=0]
----
[source,java]
.Example of even more advanced producing to WebLogic JMS with custom mapper:
----
include::{sourcedir}/mp/reactivemessaging/WeblogicSnippets.java[tag=snippet_5, indent=0]
----
=== Secured t3 over SSL(t3s)
For initiating SSL secured t3 connection, trust keystore with WLS public certificate is needed.
Standard WLS installation has pre-configured Demo trust store: `WL_HOME/server/lib/DemoTrust.jks`,
we can store it locally for connecting WLS over t3s.
[source,yaml]
.Example config:
----
mp:
messaging:
connector:
helidon-weblogic-jms:
jms-factory: jms/TestConnectionFactory
thin-jar: wlthint3client.jar
# Notice t3s protocol is used
url: t3s://localhost:7002
----
Helidon application needs to be aware about our WLS SSL public certificate.
[source,bash]
.Running example with WLS truststore
----
java --add-opens=java.base/java.io=ALL-UNNAMED \
-Djavax.net.ssl.trustStore=DemoTrust.jks \
-Djavax.net.ssl.trustStorePassword=DemoTrustKeyStorePassPhrase \
-jar ./target/helidon-wls-jms-demo.jar
----
© 2015 - 2025 Weber Informatics LLC | Privacy Policy