Could you provide the outbound-socket-binding "ssl-messaging" ?
Emmanuel
Le 10/03/2025 à 17:32, Sayantan Ganguly a écrit :
> Hi Emmanuel,
>
> This is still reproducible. We are using *activemq 2.19.1 with Wildfly 26.1.3*.
>
>
> *Configuration at k8s deployment* (activemq server), this Wildfly instance is running in a pod:
>
> *standalone.xml*
>
> <remote-connector name="ssl-remoting-connector" socket-binding="ssl-messaging">
> <param name="ssl-enabled" value="true"/>
> <param name="trust-store-password" value="${javax.net.ssl.trustStorePassword}"/>
> <param name="trust-store-path" value="${javax.net.ssl.trustStore}"/>
> <param name="trust-store-type" value="PKCS12"/>
> <param name="verify-host" value="false"/>
> <param name="host" value="*external-access-host-k8s-master-node*"/>
> </remote-connector>
>
> <connection-factory name="SslConnectionFactory" entries="java:jboss/exported/jms/SslConnectionFactory" connectors="ssl-remoting-connector"
> deserialization-black-list="..." *use-topology-for-load-balancing="false"*/>
>
>
>
> *Client configuration code, this Wildfly instance is running on a virtual machine:*
>
> Hashtable<Object, Object> env = new Hashtable<Object, Object>();
> env.put("java.naming.factory.initial", WildFlyInitialContextFactory.class.getName());
> env.put("java.naming.provider.url", "https-remoting://<external-access-host-k8s-master-node>:<external-access-port-k8s-master-node>");
> env.put("jboss.naming.client.ejb.context", true);
> env.put(Context.SECURITY_PRINCIPAL, "user");
> env.put(Context.SECURITY_CREDENTIALS, "pass");
> InitialContext context = new InitialContext(env);
> final ConnectionFactory cf = (ConnectionFactory) context.lookup("jms/SslConnectionFactory");
> *cf.createConnection("user", "pass"); //error - java.net.UnknownHostException: <service-name>-84465977b7-xsvdn*
>
>
> *Logs at client end:*
>
> 2025-03-10 08:53:06.088 DEBUG [org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl] Trying to connect with
> connectorFactory=org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory@79ebbc5c and currentConnectorConfig:
> TransportConfiguration(name=null, factory=org-apache-activemq-artemis-core-remoting-impl-netty-NettyConnectorFactory)
> ?trustStorePassword=****&port=5455&sslEnabled=true&host=<service-name>-84465977b7-xsvdn&verifyHost=false&trustStoreType=PKCS12&trustStorePath=.../abc-trust-p12&blockOnNonDurableSend=false&retryIntervalMultiplier=1-0&maxRetryInterval=2000&producerMaxRate=-1&blockOnDurableSend=true&connectionTTL=60000&compressLargeMessage=false&reconnectAttempts=0&ignoreJTA=false&cacheLargeMessagesClient=false&scheduledThreadPoolMaxSize=5&useGlobalPools=true&callFailoverTimeout=60000&deserializationBlackList=java-io-File,org-apache-commons-collections-functors-InvokerTransformer,org-apache-commons-collections-functors-InstantiateTransformer,org-apache-commons-collections4-functors-InvokerTransformer,org-apache-commons-collections4-functors-InstantiateTransformer,org-codehaus-groovy-runtime-ConvertedClosure,org-codehaus-groovy-runtime-MethodClosure,org-springframework-beans-factory-ObjectFactory,com-sun-org-apache-xalan-internal-xsltc-trax-TemplatesImpl,org-apache-xalan-xsltc-trax-TemplatesImpl,com-sun-rowset-JdbcRowSetImpl,java-util-logging-FileHandler,java-rmi-server-UnicastRemoteObject,org-springframework-beans-factory-config-PropertyPathFactoryBean,org-apache-tomcat-dbcp-dbcp2-BasicDataSource,com-sun-org-apache-bcel-internal-util-ClassLoader,org-hibernate-jmx-StatisticsService,org-apache-ibatis-datasource-jndi-JndiDataSourceFactory,org-apache-ibatis-parsing-XPathParser,jodd-db-connection-DataSourceConnectionProvider,oracle-jdbc-connector-OracleManagedConnectionFactory,oracle-jdbc-rowset-OracleJDBCRowSet,org-slf4j-ext-EventData,flex-messaging-util-concurrent-AsynchBeansWorkManagerExecutor,com-sun-deploy-security-ruleset-DRSHelper,org-apache-axis2-jaxws-spi-handler-HandlerResolverImpl,org-jboss-util-propertyeditor-DocumentEditor,org-apache-openjpa-ee-RegistryManagedRuntime,org-apache-openjpa-ee-JNDIManagedRuntime,org-apache-axis2-transport-jms-JMSOutTransportInfo,com-mysql-cj-jdbc-admin-MiniAdmin,ch-qos-logback-core-db-DriverManagerConnectionSource,org-jdom-transform-XSLTransformer,org-jdom2-transform-XSLTransformer,net-sf-ehcache-transaction-manager-DefaultTransactionManagerLookup,net-sf-ehcache-hibernate-EhcacheJtaTransactionManagerLookup,ch-qos-logback-core-db-JNDIConnectionSource,com-zaxxer-hikari-HikariConfig,com-zaxxer-hikari-HikariDataSource,org-apache-cxf-jaxrs-provider-XSLTJaxbProvider,org-apache-commons-configuration-JNDIConfiguration,org-apache-commons-configuration2-JNDIConfiguration,org-apache-xalan-lib-sql-JNDIConnectionPool,org-apache-commons-dbcp-datasources-PerUserPoolDataSource,org-apache-commons-dbcp-datasources-SharedPoolDataSource,com-p6spy-engine-spy-P6DataSource,org-apache-log4j-receivers-db-DriverManagerConnectionSource,org-apache-log4j-receivers-db-JNDIConnectionSource,net-sf-ehcache-transaction-manager-selector-GenericJndiSelector,net-sf-ehcache-transaction-manager-selector-GlassfishSelector,org-apache-xbean-propertyeditor-JndiConverter,org-apache-hadoop-shaded-com-zaxxer-hikari-HikariConfig,com-ibatis-sqlmap-engine-transaction-jta-JtaTransactionConfig,br-com-anteros-dbcp-AnterosDBCPConfig,javax-swing-JEditorPane,org-apache-shiro-realm-jndi-JndiRealmFactory,org-apache-shiro-jndi-JndiObjectFactory,org-apache-ignite-cache-jta-jndi-CacheJndiTmLookup,org-apache-ignite-cache-jta-jndi-CacheJndiTmFactory,org-quartz-utils-JNDIConnectionProvider,org-apache-aries-transaction-jms-internal-XaPooledConnectionFactory,org-apache-aries-transaction-jms-RecoverablePooledConnectionFactory,com-caucho-config-types-ResourceRef,org-apache-log4j-net-SocketServer&initialConnectAttempts=1&clientFailureCheckPeriod=30000&blockOnAcknowledge=false&consumerWindowSize=1048576&minLargeMessageSize=102400&*useTopologyForLoadBalancing=false*&finalizeChecks=false&autoGroup=false&threadPoolMaxSize=30&confirmationWindowSize=-1&transactionBatchSize=1048576&callTimeout=30000&preAcknowledge=false&enable1xPrefixes=true&cacheDestinations=false&connectionLoadBalancingPolicyClassName=org-apache-activemq-artemis-api-core-client-loadbalance-RoundRobinConnectionLoadBalancingPolicy&dupsOKBatchSize=1048576&incomingInterceptorList=&initialMessagePacketSize=1500&consumerMaxRate=-1&enableSharedClientID=true&HA=false&retryInterval=2000&factoryType=0&failoverOnInitialConnection=false&outgoingInterceptorList=&producerWindowSize=65536
> 2025-03-10 08:53:06.096 ERROR [org.apache.activemq.artemis.core.client] AMQ214016: Failed to create netty connection:
> java.net.UnknownHostException: <service-name>-84465977b7-xsvdn
>
>
> *Please note* : the k8s pod name (<service-name>-84465977b7-xsvdn) is not accessible from the virtual machine at the client end. We also
> have exposed a node port at the k8s end to make the netty port 5455 available extenally.
>
> Why is the host=<service-name>-84465977b7-xsvd getting set to internal ip even though in standalone.xml it is set to <param name="host"
> value="*external-access-host-k8s-master-node*"/>. Is there any other configuration that needs to be set in the server configration to take
> effect or is it a bug?
>
> Setting the host in the Transport constants may not work for all cases as the client is initialized for other connections, which would
> involve adding deployment logic in the client.
>
> Thanks,
> Sayantan
>
>
>
> On Wednesday, March 5, 2025 at 8:31:38 PM UTC+5:30 Sayantan Ganguly wrote:
>
> Hi,
>
> It is set to false with recent changes, but still the internal ip of the pod is used.
>
> Trying to connect with connectorFactory=org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory@6602e6cc and
> currentConnectorConfig: TransportConfiguration(name=null,
> factory=org-apache-activemq-artemis-core-remoting-impl-netty-NettyConnectorFactory)
> ?trustStorePassword=****&port=5455&sslEnabled=true&host=*<service-name>-84465977b7-xsvdn*&verifyHost=false&trustStoreType=PKCS12&trustStorePath=/var/opt/OV/shared/nnm/certificates/nnm-trust-p12&blockOnNonDurableSend=false&retryIntervalMultiplier=1-0&maxRetryInterval=2000&producerMaxRate=-1&blockOnDurableSend=true&connectionTTL=60000&compressLargeMessage=false&reconnectAttempts=0&ignoreJTA=false&cacheLargeMessagesClient=false&scheduledThreadPoolMaxSize=5&useGlobalPools=true&callFailoverTimeout=60000&deserializationBlackList=java-io-File,org-apache-commons-collections-functors-InvokerTransformer,org-apache-commons-collections-functors-InstantiateTransformer,org-apache-commons-collections4-functors-InvokerTransformer,org-apache-commons-collections4-functors-InstantiateTransformer,org-codehaus-groovy-runtime-ConvertedClosure,org-codehaus-groovy-runtime-MethodClosure,org-springframework-beans-factory-ObjectFactory,com-sun-org-apache-xalan-internal-xsltc-trax-TemplatesImpl,org-apache-xalan-xsltc-trax-TemplatesImpl,com-sun-rowset-JdbcRowSetImpl,java-util-logging-FileHandler,java-rmi-server-UnicastRemoteObject,org-springframework-beans-factory-config-PropertyPathFactoryBean,org-apache-tomcat-dbcp-dbcp2-BasicDataSource,com-sun-org-apache-bcel-internal-util-ClassLoader,org-hibernate-jmx-StatisticsService,org-apache-ibatis-datasource-jndi-JndiDataSourceFactory,org-apache-ibatis-parsing-XPathParser,jodd-db-connection-DataSourceConnectionProvider,oracle-jdbc-connector-OracleManagedConnectionFactory,oracle-jdbc-rowset-OracleJDBCRowSet,org-slf4j-ext-EventData,flex-messaging-util-concurrent-AsynchBeansWorkManagerExecutor,com-sun-deploy-security-ruleset-DRSHelper,org-apache-axis2-jaxws-spi-handler-HandlerResolverImpl,org-jboss-util-propertyeditor-DocumentEditor,org-apache-openjpa-ee-RegistryManagedRuntime,org-apache-openjpa-ee-JNDIManagedRuntime,org-apache-axis2-transport-jms-JMSOutTransportInfo,com-mysql-cj-jdbc-admin-MiniAdmin,ch-qos-logback-core-db-DriverManagerConnectionSource,org-jdom-transform-XSLTransformer,org-jdom2-transform-XSLTransformer,net-sf-ehcache-transaction-manager-DefaultTransactionManagerLookup,net-sf-ehcache-hibernate-EhcacheJtaTransactionManagerLookup,ch-qos-logback-core-db-JNDIConnectionSource,com-zaxxer-hikari-HikariConfig,com-zaxxer-hikari-HikariDataSource,org-apache-cxf-jaxrs-provider-XSLTJaxbProvider,org-apache-commons-configuration-JNDIConfiguration,org-apache-commons-configuration2-JNDIConfiguration,org-apache-xalan-lib-sql-JNDIConnectionPool,org-apache-commons-dbcp-datasources-PerUserPoolDataSource,org-apache-commons-dbcp-datasources-SharedPoolDataSource,com-p6spy-engine-spy-P6DataSource,org-apache-log4j-receivers-db-DriverManagerConnectionSource,org-apache-log4j-receivers-db-JNDIConnectionSource,net-sf-ehcache-transaction-manager-selector-GenericJndiSelector,net-sf-ehcache-transaction-manager-selector-GlassfishSelector,org-apache-xbean-propertyeditor-JndiConverter,org-apache-hadoop-shaded-com-zaxxer-hikari-HikariConfig,com-ibatis-sqlmap-engine-transaction-jta-JtaTransactionConfig,br-com-anteros-dbcp-AnterosDBCPConfig,javax-swing-JEditorPane,org-apache-shiro-realm-jndi-JndiRealmFactory,org-apache-shiro-jndi-JndiObjectFactory,org-apache-ignite-cache-jta-jndi-CacheJndiTmLookup,org-apache-ignite-cache-jta-jndi-CacheJndiTmFactory,org-quartz-utils-JNDIConnectionProvider,org-apache-aries-transaction-jms-internal-XaPooledConnectionFactory,org-apache-aries-transaction-jms-RecoverablePooledConnectionFactory,com-caucho-config-types-ResourceRef,org-apache-log4j-net-SocketServer&initialConnectAttempts=1&clientFailureCheckPeriod=30000&blockOnAcknowledge=false&consumerWindowSize=1048576&minLargeMessageSize=102400&*useTopologyForLoadBalancing=false*&finalizeChecks=false&autoGroup=false&threadPoolMaxSize=30&confirmationWindowSize=-1&transactionBatchSize=1048576&callTimeout=30000&preAcknowledge=false&enable1xPrefixes=true&cacheDestinations=false&connectionLoadBalancingPolicyClassName=org-apache-activemq-artemis-api-core-client-loadbalance-RoundRobinConnectionLoadBalancingPolicy&dupsOKBatchSize=1048576&incomingInterceptorList=&initialMessagePacketSize=1500&consumerMaxRate=-1&enableSharedClientID=true&HA=false&retryInterval=2000&factoryType=0&failoverOnInitialConnection=false&outgoingInterceptorList=&producerWindowSize=65536
> > > > > *
java.net <
http://java.net> <
http://java.net> <
http://java.net>.UnknownHostException: <service-name>-5f7ffbdddb-pkx74*
> <
https://groups.google.com/d/msgid/wildfly/e0c33b4a-fd3e-499b-84d4-dacd74bd2b61n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> You received this message because you are subscribed to the Google Groups "WildFly" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
wildfly+u...@googlegroups.com.
> To view this discussion visit
https://groups.google.com/d/msgid/wildfly/8ff5b198-10c5-4862-8271-680f3a334297n%40googlegroups.com
> <
https://groups.google.com/d/msgid/wildfly/8ff5b198-10c5-4862-8271-680f3a334297n%40googlegroups.com?utm_medium=email&utm_source=footer>.