Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2310D20049B for ; Mon, 14 Aug 2017 21:08:57 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 21647165B26; Mon, 14 Aug 2017 19:08:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 66B71165B24 for ; Mon, 14 Aug 2017 21:08:56 +0200 (CEST) Received: (qmail 92665 invoked by uid 500); 14 Aug 2017 19:08:53 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 92652 invoked by uid 99); 14 Aug 2017 19:08:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Aug 2017 19:08:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A194BC0118 for ; Mon, 14 Aug 2017 19:08:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.292 X-Spam-Level: *** X-Spam-Status: No, score=3.292 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URI_HEX=1.313] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id SdT7QyBpiERw for ; Mon, 14 Aug 2017 19:08:49 +0000 (UTC) Received: from mail-oi0-f52.google.com (mail-oi0-f52.google.com [209.85.218.52]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 143995FAF7 for ; Mon, 14 Aug 2017 19:08:49 +0000 (UTC) Received: by mail-oi0-f52.google.com with SMTP id e124so93149085oig.2 for ; Mon, 14 Aug 2017 12:08:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=sHy8KfFrJTfoIyCoW4m3Yd9Ty0m0iVbQNhhQw4KcYkU=; b=laa1xQKJa94Hqi/ot3rcYYKFkJyOQqUxwHj1QvPGAF32s41S4IhYtHLcQefJSyFyW/ fD3oRIvlQ5YrC3zi47YalvHi8AgHliMD5mzGLmz7cnZu+4+K085n4U9IMUZmB9qszDsc CzwQumKIYRAcXEYnoVgnh4BhKZP0uI5cpLgLsSuaQBMwEYj5kx/dz3V65Antprj4Yby9 QFL7nvPQKat8yIk7X+id+UsqVLJfLkchuNNk4f/uD6NTx0AuQrQdA5G7Q6PVRxLMI+GW eE4GcehJnw5lD7TX8wd+QHp5YNJzTQKbXlV9g21Tjm4um6N1eNcZnU+D/xrFB6hun+WM kAuw== X-Gm-Message-State: AHYfb5h7YqJxib4OY/1qQlRttUIoowWipnpwWD/FZ4hRoL4sacliUXn1 0jejOPaUdo0HMt8FfmJ8PuxJEMr6nueHTg0= X-Received: by 10.202.225.67 with SMTP id y64mr30022328oig.159.1502737727510; Mon, 14 Aug 2017 12:08:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.171.131 with HTTP; Mon, 14 Aug 2017 12:08:47 -0700 (PDT) In-Reply-To: References: <1502366449346-4729594.post@n4.nabble.com> From: Justin Bertram Date: Mon, 14 Aug 2017 14:08:47 -0500 Message-ID: Subject: Re: Intercept mqtt client connection To: users@activemq.apache.org Content-Type: multipart/alternative; boundary="001a113d4d6e706c970556bb643e" archived-at: Mon, 14 Aug 2017 19:08:57 -0000 --001a113d4d6e706c970556bb643e Content-Type: text/plain; charset="UTF-8" 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 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 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 > 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 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 > --001a113d4d6e706c970556bb643e--