From 6780764f1f7a275f84713db0b26f4557212f9033 Mon Sep 17 00:00:00 2001 From: ayeshLK Date: Mon, 7 Aug 2023 16:01:22 +0530 Subject: [PATCH] Update package documentation --- README.md | 24 +++++++++++++++--------- ballerina/Module.md | 24 +++++++++++++++--------- ballerina/Package.md | 24 +++++++++++++++--------- 3 files changed, 45 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 00effcee..069298e4 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,10 @@ public function main() returns error? { providerUrl = "tcp://localhost:61616" ); jms:Session session = check connection->createSession(); - jms:Destination queue = check session->createQueue("MyQueue"); - jms:MessageProducer producer = check session.createProducer(queue); + jms:MessageProducer producer = check session.createProducer({ + 'type: jms:QUEUE, + name: "MyQueue" + }); jms:TextMessage msg = { content: "Hello Ballerina!" }; @@ -61,9 +63,11 @@ public function main() returns error? { providerUrl = "tcp://localhost:61616" ); jms:Session session = check connection->createSession(); - jms:Destination queue = check session->createQueue("MyQueue"); - jms:MessageConsumer consumer = check session.createConsumer(queue); - + jms:MessageConsumer consumer = check session.createConsumer( + destination = { + 'type: jms:QUEUE, + name: "MyQueue" + }); while true { jms:Message? response = check consumer->receive(3000); if response is jms:TextMessage { @@ -88,10 +92,12 @@ service "consumer-service" on new jms:Listener( connectionConfig = { initialContextFactory: "org.apache.activemq.jndi.ActiveMQInitialContextFactory", providerUrl: "tcp://localhost:61616" - } - destination = { - 'type: jms:QUEUE, - name: "MyQueue" + }, + consumerOptions = { + destination: { + 'type: jms:QUEUE, + name: "MyQueue" + } } ) { remote function onMessage(jms:Message message) returns error? { diff --git a/ballerina/Module.md b/ballerina/Module.md index 751031a7..489186a8 100644 --- a/ballerina/Module.md +++ b/ballerina/Module.md @@ -34,8 +34,10 @@ public function main() returns error? { providerUrl = "tcp://localhost:61616" ); jms:Session session = check connection->createSession(); - jms:Destination queue = check session->createQueue("MyQueue"); - jms:MessageProducer producer = check session.createProducer(queue); + jms:MessageProducer producer = check session.createProducer({ + 'type: jms:QUEUE, + name: "MyQueue" + }); jms:TextMessage msg = { content: "Hello Ballerina!" }; @@ -56,9 +58,11 @@ public function main() returns error? { providerUrl = "tcp://localhost:61616" ); jms:Session session = check connection->createSession(); - jms:Destination queue = check session->createQueue("MyQueue"); - jms:MessageConsumer consumer = check session.createConsumer(queue); - + jms:MessageConsumer consumer = check session.createConsumer( + destination = { + 'type: jms:QUEUE, + name: "MyQueue" + }); while true { jms:Message? response = check consumer->receive(3000); if response is jms:TextMessage { @@ -83,10 +87,12 @@ service "consumer-service" on new jms:Listener( connectionConfig = { initialContextFactory: "org.apache.activemq.jndi.ActiveMQInitialContextFactory", providerUrl: "tcp://localhost:61616" - } - destination = { - 'type: jms:QUEUE, - name: "MyQueue" + }, + consumerOptions = { + destination: { + 'type: jms:QUEUE, + name: "MyQueue" + } } ) { remote function onMessage(jms:Message message) returns error? { diff --git a/ballerina/Package.md b/ballerina/Package.md index 796ad3be..410a4a20 100644 --- a/ballerina/Package.md +++ b/ballerina/Package.md @@ -33,8 +33,10 @@ public function main() returns error? { providerUrl = "tcp://localhost:61616" ); jms:Session session = check connection->createSession(); - jms:Destination queue = check session->createQueue("MyQueue"); - jms:MessageProducer producer = check session.createProducer(queue); + jms:MessageProducer producer = check session.createProducer({ + 'type: jms:QUEUE, + name: "MyQueue" + }); jms:TextMessage msg = { content: "Hello Ballerina!" }; @@ -55,9 +57,11 @@ public function main() returns error? { providerUrl = "tcp://localhost:61616" ); jms:Session session = check connection->createSession(); - jms:Destination queue = check session->createQueue("MyQueue"); - jms:MessageConsumer consumer = check session.createConsumer(queue); - + jms:MessageConsumer consumer = check session.createConsumer( + destination = { + 'type: jms:QUEUE, + name: "MyQueue" + }); while true { jms:Message? response = check consumer->receive(3000); if response is jms:TextMessage { @@ -82,10 +86,12 @@ service "consumer-service" on new jms:Listener( connectionConfig = { initialContextFactory: "org.apache.activemq.jndi.ActiveMQInitialContextFactory", providerUrl: "tcp://localhost:61616" - } - destination = { - 'type: jms:QUEUE, - name: "MyQueue" + }, + consumerOptions = { + destination: { + 'type: jms:QUEUE, + name: "MyQueue" + } } ) { remote function onMessage(jms:Message message) returns error? {