'Apache Pulsar Rar file

We have been using rar files JCA connector/Resource adapter for JBOSS to connect to ActiveMQ and looking for similar rar file for Pulsar - Do we have a similar rar file for Pulsar ?



Solution 1:[1]

This is what you are looking for https://github.com/datastax/pulsar-jms/tree/master/resource-adapter

(I am currently the maintainer of that library)

Solution 2:[2]

<mbean code="org.jboss.jms.jndi.JMSProviderLoader" name=":service=JMSProviderLoader,name=PulsarJmsNonXAProviderAsync">
    <attribute name="ProviderName">PULSARJMSNONXAProviderAsync</attribute>
    <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
    <attribute name="QueueFactoryRef">ConnectionFactory</attribute>
    <attribute name="TopicFactoryRef">ConnectionFactory</attribute>
    <attribute name="FactoryRef">ConnectionFactory</attribute>
    <attribute name="Properties">
                        java.naming.factory.initial=com.datastax.oss.pulsar.jms.jndi.PulsarInitialContextFactory
                        java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
                        java.naming.provider.url=${com.sds.prs.jboss.jms.async01.url}
                        java.naming.provider.alturl=${com.sds.prs.jboss.jms.async01.url}
                        java.naming.security.principal=${com.sds.prs.jboss.jms.async01.user}
                        java.naming.security.credentials=${com.sds.prs.jboss.jms.async01.password}
                        java.useJTA=false

                </attribute>
</mbean>
<no-tx-connection-factory>
    <jndi-name>PULSARJmsNONXA</jndi-name>
    <track-connection-by-tx/>
    <rar-name>pulsarra-rar</rar-name>
    <config-property name="Configuration" type= "java.lang.String">{"brokerServiceUrl":"pulsar+ssl://e1.message-preprod.a.com:6651", "tlsAllowInsecureConnection":"false","tlsEnableHostnameVerification":"false"}  }  </config-property>
    <config-property name="UserName" type="java.lang.String">${com.iit.bio.mdm.jms.async01.user}</config-property>
    <config-property name="Password" type="java.lang.String">${com.iit.bio.mdm.jms.async01.password}</config-property>
    <config-property name="UseInboundSession" type="java.lang.String">true</config-property>
    <connection-definition>javax.jms.QueueConnectionFactory</connection-definition>
    <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Queue</config-property>
    <blocking-timeout-millis>1000</blocking-timeout-millis>
    <idle-timeout-minutes>15</idle-timeout-minutes>
    <min-pool-size>1</min-pool-size>
    <max-pool-size>20</max-pool-size>
    <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/PULSARJMSNONXAProviderAsync</config-property>
</no-tx-connection-factory>

Solution 3:[3]

Which authentication scheme are you using ? In Pulsar it is very common to use JWT authentication. In that case you have to configure the authPlugin and authParams parameters in the ConnectionFactory.

I hope that this example helps: https://github.com/eolivelli/pulsar-jms-examples/blob/main/system.properties.auth#L24

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Enrico Olivelli
Solution 2
Solution 3 Enrico Olivelli