micronaut-projects / micronaut-jms

Integration between Micronaut and JMS
Apache License 2.0
14 stars 14 forks source link

No SSL in Native Build #205

Open deeperunderstanding opened 2 years ago

deeperunderstanding commented 2 years ago

Expected Behavior

Configuring a connection string like follows should resolve the correct transport mechanism.

micronaut:
  jms:
    activemq:
      classic:
        enabled: true
        connection-string: 'ssl://localhost:61616'

Actual Behaviour

When building a native docker image with the "dockerBuildNative" gradle task the following error occurs on application startup, when attempting to create the AMQConnectionFactory: Transport scheme NOT recognized: [ssl] The problem does not occur in JVM builds.

Steps To Reproduce

No response

Environment Information

No response

Example Application

No response

Version

3.2.4

agorges commented 2 years ago

You need to include the META-INF activemq services in the native Build (build.gradle):

graalvmNative{
    binaries {
        main {
            buildArgs.add('-H:IncludeResources="META-INF/services/org/apache/activemq/transport/ssl"')
        }
    }
}

Maybe you may also make the Factories available per reflection:

import org.apache.activemq.util.FactoryFinder;
import org.apache.activemq.transport.tcp.SslTransportFactory;

@TypeHint(
        value = {
               FactoryFinder.class,
               SslTransportFactory.class,
        },
        accessType = TypeHint.AccessType.ALL_PUBLIC
)
public class GraalVmHelper {
}

I hope that helps