Skip to content

Commit

Permalink
Simplify JMS destination lookups by removing 'java:app' prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
backwind1233 committed Oct 31, 2024
1 parent 5ebb8f9 commit 15f00eb
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
propertyValue = "jakarta.jms.Queue"),
@ActivationConfigProperty(
propertyName = "destinationLookup",
propertyValue = "java:app/jms/CargoHandledQueue")
propertyValue = "jms/CargoHandledQueue")
})
public class CargoHandledConsumer implements MessageListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
propertyValue = "jakarta.jms.Queue"),
@ActivationConfigProperty(
propertyName = "destinationLookup",
propertyValue = "java:app/jms/DeliveredCargoQueue")
propertyValue = "jms/DeliveredCargoQueue")
})
public class DeliveredCargoConsumer implements MessageListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
propertyValue = "jakarta.jms.Queue"),
@ActivationConfigProperty(
propertyName = "destinationLookup",
propertyValue = "java:app/jms/HandlingEventRegistrationAttemptQueue")
propertyValue = "jms/HandlingEventRegistrationAttemptQueue")
})
public class HandlingEventRegistrationAttemptConsumer implements MessageListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ public class JmsApplicationEvents implements ApplicationEvents, Serializable {
private static final int LOW_PRIORITY = 0;
@Inject JMSContext jmsContext;

@Resource(lookup = "java:app/jms/CargoHandledQueue")
@Resource(lookup = "jms/CargoHandledQueue")
private Destination cargoHandledQueue;

@Resource(lookup = "java:app/jms/MisdirectedCargoQueue")
@Resource(lookup = "jms/MisdirectedCargoQueue")
private Destination misdirectedCargoQueue;

@Resource(lookup = "java:app/jms/DeliveredCargoQueue")
@Resource(lookup = "jms/DeliveredCargoQueue")
private Destination deliveredCargoQueue;

@Resource(lookup = "java:app/jms/HandlingEventRegistrationAttemptQueue")
@Resource(lookup = "jms/HandlingEventRegistrationAttemptQueue")
private Destination handlingEventQueue;

@Inject private Logger logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
propertyValue = "jakarta.jms.Queue"),
@ActivationConfigProperty(
propertyName = "destinationLookup",
propertyValue = "java:app/jms/MisdirectedCargoQueue")
propertyValue = "jms/MisdirectedCargoQueue")
})
public class MisdirectedCargoConsumer implements MessageListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
propertyValue = "jakarta.jms.Queue"),
@ActivationConfigProperty(
propertyName = "destinationLookup",
propertyValue = "java:app/jms/RejectedRegistrationAttemptsQueue")
propertyValue = "jms/RejectedRegistrationAttemptsQueue")
})
public class RejectedRegistrationAttemptsConsumer implements MessageListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void init() {
public void tracking(@Context SseEventSink eventSink) {
synchronized (RealtimeCargoTrackingService.class) {
try {
String name = "java:app/jms/CargoHandledQueue";
String name = "jms/CargoHandledQueue";
InitialContext ctx = new InitialContext();
Object obj = InitialContext.doLookup(name);
} catch (NamingException e) {
Expand Down
14 changes: 7 additions & 7 deletions src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,42 +95,42 @@
maxQueueDepth="5000" />
</messagingEngine>

<jmsQueueConnectionFactory connectionManagerRef="CargoCM" jndiName="java:app/jms/QueueConnectionFactory">
<jmsQueueConnectionFactory connectionManagerRef="CargoCM" jndiName="jms/QueueConnectionFactory">
</jmsQueueConnectionFactory>

<jmsQueue id="CargoHandledQueue" jndiName="java:app/jms/CargoHandledQueue">
<jmsQueue id="CargoHandledQueue" jndiName="jms/CargoHandledQueue">
<properties.wasJms queueName="CargoHandledQueue"/>
</jmsQueue>

<jmsActivationSpec id="cargo-tracker/CargoHandledConsumer">
<properties.wasJms destinationLookup="java:app/jms/CargoHandledQueue" destinationRef="CargoHandledQueue" destinationType="jakarta.jms.Queue" maxConcurrency="200"/>
<properties.wasJms destinationLookup="jms/CargoHandledQueue" destinationRef="CargoHandledQueue" destinationType="jakarta.jms.Queue" maxConcurrency="200"/>
</jmsActivationSpec>

<jmsQueue id="MisdirectedCargoQueue" jndiName="java:app/jms/MisdirectedCargoQueue">
<jmsQueue id="MisdirectedCargoQueue" jndiName="jms/MisdirectedCargoQueue">
<properties.wasJms queueName="MisdirectedCargoQueue"/>
</jmsQueue>

<jmsActivationSpec id="cargo-tracker/MisdirectedCargoConsumer">
<properties.wasJms destinationRef="MisdirectedCargoQueue" destinationType="jakarta.jms.Queue" maxConcurrency="200"/>
</jmsActivationSpec>

<jmsQueue id="DeliveredCargoQueue" jndiName="java:app/jms/DeliveredCargoQueue">
<jmsQueue id="DeliveredCargoQueue" jndiName="jms/DeliveredCargoQueue">
<properties.wasJms queueName="DeliveredCargoQueue"/>
</jmsQueue>

<jmsActivationSpec id="cargo-tracker/DeliveredCargoConsumer">
<properties.wasJms destinationRef="DeliveredCargoQueue" destinationType="jakarta.jms.Queue" maxConcurrency="200"/>
</jmsActivationSpec>

<jmsQueue id="HandlingEventRegistrationAttemptQueue" jndiName="java:app/jms/HandlingEventRegistrationAttemptQueue">
<jmsQueue id="HandlingEventRegistrationAttemptQueue" jndiName="jms/HandlingEventRegistrationAttemptQueue">
<properties.wasJms queueName="HandlingEventRegistrationAttemptQueue"/>
</jmsQueue>

<jmsActivationSpec id="cargo-tracker/HandlingEventRegistrationAttemptConsumer">
<properties.wasJms destinationRef="HandlingEventRegistrationAttemptQueue" destinationType="jakarta.jms.Queue" maxConcurrency="200"/>
</jmsActivationSpec>

<jmsQueue id="RejectedRegistrationAttemptsQueue" jndiName="java:app/jms/RejectedRegistrationAttemptsQueue">
<jmsQueue id="RejectedRegistrationAttemptsQueue" jndiName="jms/RejectedRegistrationAttemptsQueue">
<properties.wasJms queueName="RejectedRegistrationAttemptsQueue"/>
</jmsQueue>

Expand Down
10 changes: 5 additions & 5 deletions src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,27 @@
<!-- Defining these at the application server level instead of here can
be more operations friendly and help make deployment even faster. -->
<jms-destination>
<name>java:app/jms/CargoHandledQueue</name>
<name>jms/CargoHandledQueue</name>
<interface-name>jakarta.jms.Queue</interface-name>
<destination-name>CargoHandledQueue</destination-name>
</jms-destination>
<jms-destination>
<name>java:app/jms/MisdirectedCargoQueue</name>
<name>jms/MisdirectedCargoQueue</name>
<interface-name>jakarta.jms.Queue</interface-name>
<destination-name>MisdirectedCargoQueue</destination-name>
</jms-destination>
<jms-destination>
<name>java:app/jms/DeliveredCargoQueue</name>
<name>jms/DeliveredCargoQueue</name>
<interface-name>jakarta.jms.Queue</interface-name>
<destination-name>DeliveredCargoQueue</destination-name>
</jms-destination>
<jms-destination>
<name>java:app/jms/RejectedRegistrationAttemptsQueue</name>
<name>jms/RejectedRegistrationAttemptsQueue</name>
<interface-name>jakarta.jms.Queue</interface-name>
<destination-name>RejectedRegistrationAttemptsQueue</destination-name>
</jms-destination>
<jms-destination>
<name>java:app/jms/HandlingEventRegistrationAttemptQueue</name>
<name>jms/HandlingEventRegistrationAttemptQueue</name>
<interface-name>jakarta.jms.Queue</interface-name>
<destination-name>HandlingEventRegistrationAttemptQueue</destination-name>
</jms-destination>
Expand Down

0 comments on commit 15f00eb

Please sign in to comment.