-
-
Save ayeshLK/8dbafa5e2f80b5870dd09891db883e03 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerinax/activemq.driver as _; | |
import ballerinax/java.jms; | |
public function main() returns error? { | |
jms:Connection connection = check new ( | |
initialContextFactory = "org.apache.activemq.jndi.ActiveMQInitialContextFactory", | |
providerUrl = "tcp://localhost:61616" | |
); | |
jms:Session session = check connection->createSession(); | |
jms:MessageProducer queueProducer = check session.createProducer({ | |
'type: jms:QUEUE, | |
name: "test-queue" | |
}); | |
jms:TextMessage message = { | |
content: "This is a sample message" | |
}; | |
check queueProducer->send(message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment