Uploaded image for project: 'AMQ Clients'
  1. AMQ Clients
  2. ENTMQCL-672

[ruby] open_sender and open_receiver methods could validate the parameters passed in and raise an error if the input is invalid

    XMLWordPrintable

Details

    • Story
    • Resolution: Won't Do
    • Minor
    • None
    • 2.0.0.B2
    • amqp-ruby-client
    • None

    Description

      If I do not set :source in a receiver (because I set :target by mistake, say)

          def on_container_start(container)
            # Connecting to broker and creating receiver
            @receiver = container.connect(
              [...]
            ).open_receiver(:target => { :address => @broker.amqp_address })
      

      I get this from the client

      [0x2a4a280]:  -> SASL
      [0x2a4a280]:  <- SASL
      [0x2a4a280]:0 <- @sasl-mechanisms(64) [sasl-server-mechanisms=@PN_SYMBOL[:PLAIN, :ANONYMOUS]]
      [0x2a4a280]:0 -> @sasl-init(65) [mechanism=:ANONYMOUS, initial-response=b"anonymous@nixos"]
      [0x2a4a280]:0 <- @sasl-outcome(68) [code=0]
      [0x2a4a280]:  -> AMQP
      [0x2a4a280]:0 -> @open(16) [container-id="149495fc-3779-4b06-9496-25f1b2e7c63f", max-frame-size=1048576, channel-max=32767]
      [0x2a4a280]:0 -> @begin(17) [next-outgoing-id=0, incoming-window=1, outgoing-window=2147483647]
      [0x2a4a280]:0 -> @attach(18) [name="149495fc-3779-4b06-9496-25f1b2e7c63f/1", handle=0, role=true, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [durable=0, timeout=0, dynamic=false], target=@target(41) [address="lala", durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]
      [0x2a4a280]:  <- AMQP
      [0x2a4a280]:0 <- @open(16) [container-id="amq", max-frame-size=4294967295, channel-max=65535, idle-time-out=30000, offered-capabilities=@PN_SYMBOL[:"sole-connection-for-container", :"DELAYED_DELIVERY", :"SHARED-SUBS", :"ANONYMOUS-RELAY"], properties={:product="apache-activemq-artemis", :version="2.4.0.amq-710004-redhat-1"}]
      [0x2a4a280]:0 <- @begin(17) [remote-channel=0, next-outgoing-id=1, incoming-window=2147483647, outgoing-window=2147483647, handle-max=65535]
      [0x2a4a280]:0 <- @close(24) [error=@error(29) [condition=:"amqp:internal-error", description="Unrecoverable error: NullPointerException"]]
      [0x2a4a280]:  <- EOS
      /home/jdanek/Work/repos/cli-proton-ruby/lib/handlers/sr_common_handler.rb:61:in `on_error': amqp:internal-error: Unrecoverable error: NullPointerException (Qpid::Proton::Condition)
      	from /home/jdanek/.gem/ruby/2.5.0/gems/qpid_proton-0.22.0/lib/handler/adapter.rb:74:in `forward'
      	from /home/jdanek/.gem/ruby/2.5.0/gems/qpid_proton-0.22.0/lib/handler/messaging_adapter.rb:31:in `delegate_error'
      	from /home/jdanek/.gem/ruby/2.5.0/gems/qpid_proton-0.22.0/lib/handler/messaging_adapter.rb:53:in `block (2 levels) in open_close'
      	from /home/jdanek/.gem/ruby/2.5.0/gems/qpid_proton-0.22.0/lib/core/event.rb:94:in `dispatch'
      	from /home/jdanek/.gem/ruby/2.5.0/gems/qpid_proton-0.22.0/lib/core/connection_driver.rb:194:in `block in dispatch'
      	from /home/jdanek/.gem/ruby/2.5.0/gems/qpid_proton-0.22.0/lib/core/connection_driver.rb:78:in `each_event'
      	from /home/jdanek/.gem/ruby/2.5.0/gems/qpid_proton-0.22.0/lib/core/connection_driver.rb:188:in `dispatch'
      	from /home/jdanek/.gem/ruby/2.5.0/gems/qpid_proton-0.22.0/lib/core/connection_driver.rb:204:in `process'
      	from /home/jdanek/.gem/ruby/2.5.0/gems/qpid_proton-0.22.0/lib/core/container.rb:177:in `block in run_one'
      	from /home/jdanek/.gem/ruby/2.5.0/gems/qpid_proton-0.22.0/lib/core/container.rb:133:in `maybe_panic'
      	from /home/jdanek/.gem/ruby/2.5.0/gems/qpid_proton-0.22.0/lib/core/container.rb:177:in `run_one'
      	from /home/jdanek/.gem/ruby/2.5.0/gems/qpid_proton-0.22.0/lib/core/container.rb:347:in `run'
      	from /home/jdanek/Work/repos/cli-proton-ruby/lib/receiver_client.rb:48:in `initialize'
      	from /home/jdanek/Work/repos/cli-proton-ruby/bin/cli-proton-ruby-receiver:21:in `new'
      	from /home/jdanek/Work/repos/cli-proton-ruby/bin/cli-proton-ruby-receiver:21:in `<top (required)>'
      	from -e:1:in `load'
      	from -e:1:in `<main>'
      
      Process finished with exit code 1
      

      And on the Artemis broker

      2018-03-27 14:38:10,330 WARN  [org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler] null: java.lang.NullPointerException
              at org.apache.activemq.artemis.utils.CompositeAddress.isFullyQualified(CompositeAddress.java:69) [artemis-commons-2.4.0.amq-710004-redhat-1.jar:2.4.0.amq-710004-redhat-1]
              at org.apache.activemq.artemis.protocol.amqp.proton.ProtonServerSenderContext.initialise(ProtonServerSenderContext.java:259) [artemis-amqp-protocol-2.4.0.amq-710004-redhat-1.jar:]
              at org.apache.activemq.artemis.protocol.amqp.proton.AMQPSessionContext.addSender(AMQPSessionContext.java:168) [artemis-amqp-protocol-2.4.0.amq-710004-redhat-1.jar:]
              at org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.remoteLinkOpened(AMQPConnectionContext.java:235) [artemis-amqp-protocol-2.4.0.amq-710004-redhat-1.jar:]
              at org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.onRemoteOpen(AMQPConnectionContext.java:452) [artemis-amqp-protocol-2.4.0.amq-710004-redhat-1.jar:]
              at org.apache.activemq.artemis.protocol.amqp.proton.handler.Events.dispatch(Events.java:68) [artemis-amqp-protocol-2.4.0.amq-710004-redhat-1.jar:]
              at org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.dispatch(ProtonHandler.java:452) [artemis-amqp-protocol-2.4.0.amq-710004-redhat-1.jar:]
              at org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.flush(ProtonHandler.java:279) [artemis-amqp-protocol-2.4.0.amq-710004-redhat-1.jar:]
              at org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.inputBuffer(ProtonHandler.java:243) [artemis-amqp-protocol-2.4.0.amq-710004-redhat-1.jar:]
              at org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.inputBuffer(AMQPConnectionContext.java:150) [artemis-amqp-protocol-2.4.0.amq-710004-redhat-1.jar:]
              at org.apache.activemq.artemis.protocol.amqp.broker.ActiveMQProtonRemotingConnection.bufferReceived(ActiveMQProtonRemotingConnection.java:141) [artemis-amqp-protocol-2.4.0.amq-710004-redhat-1.jar:]
              at org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:642) [artemis-server-2.4.0.amq-710004-redhat-1.jar:2.4.0.amq-710004-redhat-1]
              at org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:68) [artemis-core-client-2.4.0.amq-710004-redhat-1.jar:2.4.0.amq-710004-redhat-1]
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-all-4.1.16.Final-redhat-2.jar:4.1.16.Final-redhat-2]
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-all-4.1.16.Final-redhat-2.jar:4.1.16.Final-redhat-2]
              at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-all-4.1.16.Final-redhat-2.jar:4.1.16.Final-redhat-2]
              at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359) [netty-all-4.1.16.Final-redhat-2.jar:4.1.16.Final-redhat-2]
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-all-4.1.16.Final-redhat-2.jar:4.1.16.Final-redhat-2]
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-all-4.1.16.Final-redhat-2.jar:4.1.16.Final-redhat-2]
              at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935) [netty-all-4.1.16.Final-redhat-2.jar:4.1.16.Final-redhat-2]
              at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:797) [netty-all-4.1.16.Final-redhat-2.jar:4.1.16.Final-redhat-2]
              at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:404) [netty-all-4.1.16.Final-redhat-2.jar:4.1.16.Final-redhat-2]
              at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:304) [netty-all-4.1.16.Final-redhat-2.jar:4.1.16.Final-redhat-2]
              at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [netty-all-4.1.16.Final-redhat-2.jar:4.1.16.Final-redhat-2]
              at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_172]
      

      Attachments

        Issue Links

          Activity

            People

              jross@redhat.com Justin Ross
              jdanek@redhat.com Jiri Daněk
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: