Re: Intercept mqtt client connection

2017-12-14 Thread Justin Bertram
What you want to do is possible using an interceptor like you've implemented. The broker even ships with a working example demonstrating a working MQTT interceptor. It's called "interceptor-client-mqtt". Your interceptor code looks fine. Did you add it to your broker.xml? Justin On Thu, Dec

Re: Intercept mqtt client connection

2017-08-17 Thread aragoubi
Finally, I succeeded, I compiled project with modification, and replaced the jar into artemis lib folder, and now the broker is able to intercept mqtt connection. Thank you for your help and suggestions. -- View this message in context: http://activemq.2283324.n4.nabble.com/Artemis-Intercept-mq

Re: Intercept mqtt client connection

2017-08-17 Thread Justin Bertram
I forgot to mention that you'll need to add Otavio's repo as a remote to be able to get his commit for the cherry-pick. You can do that like so: git remote add orpiske https://github.com/orpiske/activemq-artemis.git Justin On Thu, Aug 17, 2017 at 8:14 AM, Justin Bertram wrote: > Assuming y

Re: Intercept mqtt client connection

2017-08-17 Thread Justin Bertram
Assuming you've got the Artemis repo from GitHub cloned locally you can just do this: git checkout master git cherry-pick 48b9573c66d428722fab172290865b986573f764 mvn clean install -Prelease Ideally you could just do the cherry-pick on top of the 2.2.0 branch, but there's a conflict based o

Re: Intercept mqtt client connection

2017-08-17 Thread aragoubi
I want to intercept clients when trying to connect in order to do some checks before allowing them to connect. How could I add needed features to cshanon broker interceptor? Is cshanon broker interceptor different from the interceptor of Artemis 2.1.0 ? I don't have any idea about cshanon broker i

Re: Intercept mqtt client connection

2017-08-16 Thread Clebert Suconic
Maybe you could look at the new broker interceptor that cshanon wrote ? Maybe you could add needed features there. Or are you looking at lower level protocol interception ? On Wed, Aug 16, 2017 at 11:55 AM aragoubi wrote: > I tried to add the modification to the code. > I imported all the projec

Re: Intercept mqtt client connection

2017-08-16 Thread aragoubi
I tried to add the modification to the code. I imported all the project, then I tried to compile the artemis-mqtt-project in order to get .class files. I tried also to generate a jar file. But It doesn't work. I get a lot of error when I try to import all projects in eclipse. Do you have an idea of

Re: Intercept mqtt client connection

2017-08-14 Thread Justin Bertram
When the broker was first developed it only supported the core protocol. The client/server would exchange objects which implement org.apache.activemq.artemis.core.protocol.core.Packet. Interceptors would intercept packet implementations. That terminology has stuck when referring to other protocols

Re: Intercept mqtt client connection

2017-08-14 Thread Jiri Danek
On Mon, Aug 14, 2017 at 7:29 PM, Justin Bertram wrote: > > I believe it's because it's not implemented. > > Agreed. It looks to me like only the publish packets are intercepted I've been wondering, why are they called "packets"? They are not the IP packets, so why reuse the word? I haven't see

Re: Intercept mqtt client connection

2017-08-14 Thread Justin Bertram
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 wrote: > +1 for adding i

Re: Intercept mqtt client connection

2017-08-14 Thread Otavio Piske
+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 wrote: > > I believe it's because it's not implemented. > > Agreed. It looks to me like only the publish packets are interce

Re: Intercept mqtt client connection

2017-08-14 Thread Justin Bertram
> 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 Pi

Re: Intercept mqtt client connection

2017-08-14 Thread Otavio Piske
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, aragou