Skip to content

URISupport.ParseQuery Exception for Failover URI with Query #1901

@W2R-DS

Description

@W2R-DS

This concerns Apache.NMS or Apache.NMS.ActiveMQ but issues are not enabled for those repos, there is no dedicated project to create a JIRA account, and mailing list discussion suggests to make issues here.

Failover URIs with query arguments in the failover portion throw an exception in URISupport.ParseQuery. This occurs using the following:

var uri = URISupport.CreateCompatibleUri("failover:(ssl://broker-0.example.com:61617?keepAlive=true,ssl://broker-1.example.com:61617?keepAlive=true)");
var parsed = URISupport.ParseQuery(uri.Query);

Apache.NMS.NMSException
HResult=0x80131500
Message=Invalid Uri parameter: keepAlive=true,ssl://broker-1.example.com:61617?keepAlive=true)
Source=Apache.NMS
StackTrace:
at Apache.NMS.Util.URISupport.ParseQuery(String query)
at ActiveMQFailoverTest.Program.Main(String[] args) in ...:line 11

If URISupport.ParseQuery is not intended to be used in this simpified example, this issue occurs with the following trace in conjunction with Apache.NMS.ActiveMQ:

Stack Trace:
at Apache.NMS.Util.URISupport.ParseQuery(String query)
at Apache.NMS.ActiveMQ.Transport.Tcp.TcpTransportFactory.CompositeConnect(Uri location)
at Apache.NMS.ActiveMQ.Transport.Tcp.TcpTransportFactory.CreateTransport(Uri location)

Digging deeper, the Uri object is not parsing this failover URI very well. This does not look avoidable due to arguments in Apache.NMS.ActiveMQ accepting string representations of URIs convert them into Uri objects fairly quickly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions