ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
136 stars 64 forks source link

Ballerina ActiveMQ driver fails with GraalVM native executable #7394

Closed ayeshLK closed 20 hours ago

ayeshLK commented 22 hours ago

Description

$subject

When using failover protocol with Ballerina ActiveMQ driver GraalVM native executable fails with an error.

error: Error occurred while connecting to broker: Could not create Transport. Reason: java.io.IOException: Transport scheme NOT recognized: [failover]

Steps to Reproduce

  1. Start ActiveMQ Artemis server.
docker run --name mycontainer -p 61616:61616 -p 8161:8161 --rm apache/activemq-artemis:latest-alpine
  1. Use following sample code.
import ballerinax/java.jms;
import ballerina/log;
import ballerinax/activemq.driver as _;

service on new jms:Listener(
    connectionConfig = {
        initialContextFactory: "org.apache.activemq.jndi.ActiveMQInitialContextFactory",
        providerUrl: "failover:(tcp://localhost:61616)",
        username: "artemis",
        password: "artemis"
    },
    consumerOptions = {
        destination: {
            'type: jms:QUEUE,
            name: "order-queue"
        }
    }
) {
    remote function onMessage(jms:Message message) returns error? {
        if message is jms:MapMessage {
            log:printInfo("Order message received", content = message.content.toString());
        }
    }
}
  1. Build GraalVM native executable.
bal build --graalvm
  1. Run the generated native executable.

Version

2201.10.2

Environment Details (with versions)

No response

github-actions[bot] commented 20 hours ago

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.