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 EE 10. 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 Oracle Software Delivery Cloud as wlthint3client.jakarta. However, Jakarta based thin clients can be placed on the Helidon classpath and used with this specialized connector or
the JMS connector
After the download, the thin T3 client artefact needs to be installed in the Maven repository accessible from the application build.
Maven Coordinates
To enable WebLogic JMS connector,
add the following dependency to your project’s pom.xml (see
Managing Dependencies).
<dependency>
<groupId>io.helidon.messaging.wls-jms</groupId>
<artifactId>helidon-messaging-wls-jms</artifactId>
</dependency>
Configuration
Connector name: helidon-weblogic-jms
|
The JNDI name of the JMS factory configured in WebLogic. |
|
t3, t3s, or http address of WebLogic Server. |
|
Filepath to the WebLogic thin T3 client jar ( |
|
The WebLogic initial context principal (user). |
|
The WebLogic initial context credential (password) |
|
The possible values are: |
|
The queue or topic name in WebLogic CDI (Create Destination Identifier) Syntax. |
|
JNDI destination identifier. When no such JNDI destination is found, falls back to |
|
The possible values are: |
|
Indicates whether the session will use a local transaction. Default value: |
|
The JMS API message selector expression based on a subset of the SQL92. Expression can access only headers and properties, not the payload. |
|
The client identifier for JMS connection. |
|
True for creating durable consumer (only for topic). Default value: |
|
The subscriber name for the durable consumer used to identify subscription. |
|
If |
|
Select in case factory is injected as a named bean or configured with name. |
|
The timeout interval (in millis) for polling for the next message in every poll cycle. Default value: |
|
The period for executing poll cycles in millis. Default value: |
|
When multiple channels share the same |
|
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 WebLogic CDI Syntax.
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:
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.
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
@Incoming("from-wls")
public void consumeWls(String msg) {
System.out.println("WebLogic says: " + msg);
}
@Incoming("from-wls")
@Acknowledgment(Acknowledgment.Strategy.MANUAL)
public CompletionStage<Void> consumewls(JmsMessage<String> msg) {
System.out.println("WebLogic says: " + msg.getPayload());
return msg.ack();
}
Producing
@Outgoing("to-wls")
public PublisherBuilder<String> produceToWls() {
return ReactiveStreams.of("test1", "test2");
}
@Outgoing("to-wls")
public PublisherBuilder<Message<String>> produceToJms() {
return ReactiveStreams.of("test1", "test2")
.map(s -> JmsMessage.builder(s)
.correlationId(UUID.randomUUID().toString())
.property("stringProp", "cool property")
.property("byteProp", 4)
.property("intProp", 5)
.onAck(() -> CompletableFuture.completedStage(null)
.thenRun(() -> System.out.println("Acked!")))
.build());
}
@Outgoing("to-wls")
public PublisherBuilder<Message<String>> produceToJms() {
return ReactiveStreams.of("test1", "test2")
.map(s -> JmsMessage.builder(s)
.customMapper((p, session) -> {
TextMessage textMessage = session.createTextMessage(p);
textMessage.setStringProperty("custom-mapped-property", "XXX" + p);
return textMessage;
})
.build()
);
}
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.
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.
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