activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Bertram <jbert...@redhat.com>
Subject Re: Intercept mqtt client connection
Date Mon, 14 Aug 2017 19:08:47 GMT
Take a look
at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl#invokeInterceptors.
I think the MQTT and STOMP protocol managers should be calling that instead
of invoking the interceptors themselves.


Justin

On Mon, Aug 14, 2017 at 1:38 PM, Otavio Piske <opiske@redhat.com> wrote:

> +1 for adding it, unless there's a reason not to.
>
> I'm playing w/ the code for this and will send a PR sometime this week.
>
> On Mon, Aug 14, 2017 at 7:29 PM, Justin Bertram <jbertram@redhat.com>
> wrote:
>
> > > I believe it's because it's not implemented.
> >
> > Agreed.  It looks to me like only the publish packets are intercepted
> > currently.  Unless this was done very specifically then I think the logic
> > should be modified to intercept all kinds of packets.
> >
> >
> > Justin
> >
> > On Mon, Aug 14, 2017 at 12:23 PM, Otavio Piske <opiske@redhat.com>
> wrote:
> >
> > > I believe it's because it's not implemented.
> > >
> > > I did a small modification to the code to test this hypothesis:
> > > https://github.com/orpiske/activemq-artemis/commit/
> > > bd57548b6b2897a436240d6abadc1a8e01a1acc9.
> > >
> > >
> > > After that, it can intercept Connect control packets.
> > >
> > > On Thu, Aug 10, 2017 at 2:00 PM, aragoubi <aymen.rag@gmail.com> wrote:
> > >
> > > > I added an mqtt interceptor into my artemis broker in order to
> > intercept
> > > > mqtt
> > > > client connection:
> > > >
> > > >
> > > >
> > > > /public class SimpleMQTTInterceptor implements MQTTInterceptor
> > > > {
> > > >         @Override
> > > >         public boolean intercept(final MqttMessage mqttMessage,
> > > > RemotingConnection
> > > > connection) throws ActiveMQException
> > > >         {
> > > >                 System.out.println("MQTT Interceptor gets called ");
> > > >
> > > >                 if (mqttMessage instanceof MqttConnectMessage)
> > > >                 {
> > > >                         System.out.println("MQTT connection
> intercepted
> > > ");
> > > >                 }
> > > >                 return true;
> > > >         }
> > > > }/
> > > >
> > > > My problem is that only message published to topics are intercepted.
> > > > Why this doesn't intercept *CONNECT* message ?
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > View this message in context: http://activemq.2283324.n4.
> > > > nabble.com/Intercept-mqtt-client-connection-tp4729594.html
> > > > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> > > >
> > >
> > >
> > >
> > > --
> > > Otavio R. Piske
> > > Messaging Quality Assurance Engineer
> > >
> >
>
>
>
> --
> Otavio R. Piske
> Messaging Quality Assurance Engineer
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message