payara / ecosystem-support

Placeholder repository to handle community requests for the Payara Platform ecosystem tools
3 stars 2 forks source link

How to set bootstrapServersConfig on Wildfly #21

Closed jgrabowski closed 3 years ago

jgrabowski commented 3 years ago

Hi, I tried to set up resource adapter on Wildfly 20. I've deployed resource adapter and tried to activate it, but it gives me connection error as it tries to connect to default localhost address and not the provided one.

My setup:

/subsystem=resource-adapters/resource-adapter=kafka:add(transaction-support=XATransaction,archive=kafka-rar-0.6.0.rar)
/subsystem=resource-adapters/resource-adapter=kafka/connection-definitions=kafka:add(class-name="fish.payara.cloud.connectors.kafka.outbound.KafkaManagedConnectionFactory",jndi-name="java:/KafkaConnectionFactory",enabled=true,min-pool-size=1,max-pool-size=20,same-rm-override=false,pool-prefill=false)
/subsystem=resource-adapters/resource-adapter=kafka/connection-definitions=kafka/config-properties=bootstrapServersConfig:add(value=172.17.0.1:9092)

It gives following entry in standalone-full.xml:

<subsystem xmlns="urn:jboss:domain:resource-adapters:6.0">
            <resource-adapters>
                <resource-adapter id="kafka">
                    <archive>
                        kafka-rar-0.6.0.rar
                    </archive>
                    <transaction-support>XATransaction</transaction-support>
                    <connection-definitions>
                        <connection-definition class-name="fish.payara.cloud.connectors.kafka.outbound.KafkaManagedConnectionFactory" jndi-name="java:/KafkaConnectionFactory" enabled="true" pool-name="kafka">
                            <config-property name="bootstrapServersConfig">172.17.0.1:9092</config-property>
                            <xa-pool>
                                <min-pool-size>1</min-pool-size>
                                <max-pool-size>20</max-pool-size>
                                <prefill>false</prefill>
                                <is-same-rm-override>false</is-same-rm-override>
                            </xa-pool>
                        </connection-definition>
                    </connection-definitions>
                </resource-adapter>
            </resource-adapters>
        </subsystem>

How to adjust it to use different address?

jgrabowski commented 3 years ago

The problem is: 15:40:10,727 WARN [org.apache.kafka.clients.NetworkClient] (kafka-producer-network-thread | KafkaJCAClient) [Producer clientId=KafkaJCAClient] Connection to node 0 (/127.0.0.1:9092) could not be established. Broker may not be available.

I've reconfigured Kafka's advertised address and it seems to deliver messages to wildfly properly, but anyway I'm receiveing these nasty load of WARNings in log file.

MeroRai commented 3 years ago

Hi @jgrabowski, since the issue is not related to Payara Server or Payara micro, I am closing it. Thank you for your understanding.