Skip to content

Commit

Permalink
Merge pull request #92 from ayeshLK/local_development
Browse files Browse the repository at this point in the history
Update package documentation
  • Loading branch information
ayeshLK committed Aug 7, 2023
2 parents 359586a + 6780764 commit 631efb6
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 27 deletions.
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
};
Expand All @@ -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 {
Expand All @@ -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? {
Expand Down
24 changes: 15 additions & 9 deletions ballerina/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
};
Expand All @@ -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 {
Expand All @@ -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? {
Expand Down
24 changes: 15 additions & 9 deletions ballerina/Package.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
};
Expand All @@ -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 {
Expand All @@ -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? {
Expand Down

0 comments on commit 631efb6

Please sign in to comment.