Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-2310

Variable substitution does not happen with xinclude'd sub files

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.0
    • Fix Version/s: 2.8.0
    • Component/s: Broker
    • Labels:
      None

      Description

      The variable substitution mechanism which set values from system properties only works for the root configuration document.

      when fragments are imported from xinclude, the placeholder stays untouched

      sample

      test.broker.xml
      (...)
      
      		<acceptors xmlns="urn:activemq:core">
      			<acceptor name="in-vm">vm://1</acceptor>
      			<acceptor name="netty-ssl">tcp://localhost:6161?protocols=CORE,OPENWIRE,AMQP;sslEnabled=true;needClientAuth=true;keyStorePath=localhost.jks;keyStorePassword=*******;trustStorePath=CA.jks;trustStorePassword=*********;needClientAuth=true;forceSSLParameters=true;enabledCipherSuites=TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384;enabledProtocols=${tls.protocols}</acceptor>
      		</acceptors>
      (...)
      

      produces

      15:57:42.487 DEBUG o.a.activemq.artemis.utils.XMLUtil - replacing ${tls.protocols} with TLSv1.3,TLSv1.2
      15:57:42.965 DEBUG o.a.a.a.c.s.impl.ActiveMQServerImpl - Starting server ActiveMQServerImpl::
      

      when replaced with

      test-broker.xml
                <xi:include href="test-acceptors.xml"/>
      
      test-acceptors.xml
      		<acceptors xmlns="urn:activemq:core">
      			<acceptor name="in-vm">vm://1</acceptor>
      			<acceptor name="netty-ssl">tcp://localhost:6161?protocols=CORE,OPENWIRE,AMQP;sslEnabled=true;needClientAuth=true;keyStorePath=localhost.jks;keyStorePassword=********;trustStorePath=CA.jks;trustStorePassword=*******;needClientAuth=true;forceSSLParameters=true;enabledCipherSuites=TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384;enabledProtocols=${tls.protocols}</acceptor>
      		</acceptors>
      

      produces

      15:59:44.953 ERROR ArtemisTest - Artemis failed to start
      java.lang.RuntimeException: Illegal character in query at index 1067: tcp://localhost:6161?protocols=CORE,OPENWIRE,AMQP&sslEnabled=true&needClientAuth=true&keyStorePath=localhost.jks&keyStorePassword=********&trustStorePath=CA.jks&trustStorePassword=********&needClientAuth=true&forceSSLParameters=true&enabledCipherSuites=TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384&enabledProtocols=${tls.protocols}
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jbertram Justin Bertram
                Reporter:
                slx SL
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m