File tree Expand file tree Collapse file tree 5 files changed +30
-18
lines changed
examples/ez-food/order-svc Expand file tree Collapse file tree 5 files changed +30
-18
lines changed Original file line number Diff line number Diff line change @@ -22,4 +22,3 @@ filePath = "persist/model.bal"
2222groupId = " io.ballerina.stdlib"
2323artifactId = " persist.inmemory-native"
2424version = " 1.6.0"
25-
Original file line number Diff line number Diff line change 1+ // Copyright (c) 2025, WSO2 LLC. (http://www.wso2.org).
2+ //
3+ // WSO2 LLC. licenses this file to you under the Apache License,
4+ // Version 2.0 (the "License"); you may not use this file except
5+ // in compliance with the License.
6+ // You may obtain a copy of the License at
7+ //
8+ // http://www.apache.org/licenses/LICENSE-2.0
9+ //
10+ // Unless required by applicable law or agreed to in writing,
11+ // software distributed under the License is distributed on an
12+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
13+ // KIND, either express or implied. See the License for the
14+ // specific language governing permissions and limitations
15+ // under the License.
16+
17+ import ballerinax /java .jms ;
18+
19+ const string ORDERS_QUEUE = " orders" ;
20+ const string ORDER_CONFIRMATIONS_QUEUE = " order-confirmation" ;
21+ const string ORDER_STATUS_UPDATE_TOPIC = " order-status-update" ;
22+
23+ configurable jms : ConnectionConfiguration activeMqConnectionConfig = {
24+ initialContextFactory : " org.apache.activemq.jndi.ActiveMQInitialContextFactory" ,
25+ providerUrl : " tcp://localhost:61616"
26+ };
27+
28+ listener jms : Listener activeMqListener = check new (activeMqConnectionConfig );
Original file line number Diff line number Diff line change @@ -17,14 +17,10 @@ import ordersvc.store;
1717
1818import ballerinax /java .jms ;
1919
20- const string ORDER_CONFIRMATIONS_QUEUE = " order-confirmation" ;
21-
22- listener jms : Listener orderConfirmationListener = check new (activeMqConnectionConfig );
23-
2420@jms :ServiceConfig {
2521 queueName : ORDER_CONFIRMATIONS_QUEUE
2622}
27- service " order-confirmation-receiver" on orderConfirmationListener {
23+ service " order-confirmation-receiver" on activeMqListener {
2824 remote function onMessage(jms : Message message ) returns error ? {
2925 if message ! is jms : BytesMessage {
3026 return ;
Original file line number Diff line number Diff line change 1616import ballerinax /activemq .driver as _ ;
1717import ballerinax /java .jms ;
1818
19- const string ORDER_STATUS_UPDATE_TOPIC = " order-status-update" ;
20-
21- listener jms : Listener orderStatusListener = check new (activeMqConnectionConfig );
22-
2319@jms :ServiceConfig {
2420 topicName : ORDER_STATUS_UPDATE_TOPIC ,
2521 subscriberName : " order-service-consumer"
2622}
27- service " order-status-update-receiver" on orderStatusListener {
23+ service " order-status-update-receiver" on activeMqListener {
2824 remote function onMessage(jms : Message message ) returns error ? {
2925 if message ! is jms : BytesMessage {
3026 return ;
Original file line number Diff line number Diff line change @@ -31,13 +31,6 @@ isolated function getNextOrderId() returns int {
3131 }
3232}
3333
34- const string ORDERS_QUEUE = " orders" ;
35-
36- configurable jms : ConnectionConfiguration activeMqConnectionConfig = {
37- initialContextFactory : " org.apache.activemq.jndi.ActiveMQInitialContextFactory" ,
38- providerUrl : " tcp://localhost:61616"
39- };
40-
4134final store : Client datastore = check new ();
4235
4336# A service representing an online food ordering system
You can’t perform that action at this time.
0 commit comments