[ 
https://issues.apache.org/jira/browse/AMQ-6870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16303273#comment-16303273
 ] 

Alejandro Fernandez Haro commented on AMQ-6870:
-----------------------------------------------

>From the camel XML configuration I supplied, we can see the used class is 
>{{org.apache.activemq.ActiveMQConnectionFactory}}.
It returns an instance of StompSslTransportFactory because of the SSL+STOMP URL 
options. So it sounds like it’s supported (there is an specific class for it). 
I’d say, instead, that class is broken and not compliant with the 
TransportFactory requirements. 

I would say it’s either TransportFactory enforcing {{wireFormat.host}}, not 
taking into account the transport factories called, depending on the protocols, 
or just StompSslTransportFactory needing an update to support that enforced 
parameter instead of refusing to establish the connection because that 
parameter is not allowed.

> java.lang.IllegalArgumentException: Invalid connect parameters: 
> {wireFormat.host=localhost}
> -------------------------------------------------------------------------------------------
>
>                 Key: AMQ-6870
>                 URL: https://issues.apache.org/jira/browse/AMQ-6870
>             Project: ActiveMQ
>          Issue Type: Bug
>            Reporter: Alejandro Fernandez Haro
>
> I want to connect to my broker using STOMP+SSL as because my broker is 
> exposing that protocol:
> {code:xml}
> <transportConnector name="stomp+nio+ssl" 
> uri="stomp+nio+ssl://0.0.0.0:61612?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
> {code}
> The connector is working fine because I'm able to connect to it with a 
> Javascript library and another Ruby one.
> But when using the Java libraries, by applying the connection string 
> {{"stomp+ssl://localhost:61612"}} or 
> {{"ssl://localhost:61612?wireFormat=stomp"}} it fails because of a bug in the 
> StompSslTransportFactory not supporting the field {{wireFormat.host}}.
> An easy way to get the same error is by applying the following config in 
> camel:
> {code:xml}
> <bean id="myConnectionFactory" 
> class="org.apache.activemq.ActiveMQConnectionFactory">
>     <property name="brokerURL" value="stomp+ssl://localhost:61612"/>
>     <!-- or with <property name="brokerURL" 
> value="ssl://localhost:61612?wireFormat=stomp"/> -->
>     <property name="userName" value="${amq.user}"/>
>     <property name="password" value="${amq.pass}"/>
> </bean>
> {code}
> The error I'm getting is:
> {code}
> Invalid connect parameters: {wireFormat.host=localhost}
> {code}
> I think it might be related to this piece of code where it enforces the value 
> if it doesn't exist:
> {code:title=org/apache/activemq/transport/TransportFactory.java}
>     public Transport doConnect(URI location) throws Exception { 
>         try { 
>             Map<String, String> options = new HashMap<String, 
> String>(URISupport.parseParameters(location)); 
>             if( !options.containsKey("wireFormat.host") ) { 
>                 options.put("wireFormat.host", location.getHost()); 
>             } 
>             WireFormat wf = createWireFormat(options); 
>             Transport transport = createTransport(location, wf); 
>             Transport rc = configure(transport, wf, options); 
>             if (!options.isEmpty()) { 
>                 throw new IllegalArgumentException("Invalid connect 
> parameters: " + options); 
>             } 
>             return rc; 
>         } catch (URISyntaxException e) { 
>             throw IOExceptionSupport.create(e); 
>         } 
>     } 
> {code}
> Here's another experience from another guy suffering from the same bug: 
> http://activemq.2283324.n4.nabble.com/quot-wireFormat-host-quot-option-for-StompSslTransportFactory-td4685162.html



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to