Return-Path: X-Original-To: apmail-stratos-dev-archive@minotaur.apache.org Delivered-To: apmail-stratos-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 92A0F116AF for ; Tue, 2 Sep 2014 08:47:11 +0000 (UTC) Received: (qmail 20150 invoked by uid 500); 2 Sep 2014 08:47:08 -0000 Delivered-To: apmail-stratos-dev-archive@stratos.apache.org Received: (qmail 20095 invoked by uid 500); 2 Sep 2014 08:47:08 -0000 Mailing-List: contact dev-help@stratos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stratos.apache.org Delivered-To: mailing list dev@stratos.apache.org Received: (qmail 20082 invoked by uid 99); 2 Sep 2014 08:47:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2014 08:47:08 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dineshb@wso2.com designates 74.125.82.179 as permitted sender) Received: from [74.125.82.179] (HELO mail-we0-f179.google.com) (74.125.82.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2014 08:47:04 +0000 Received: by mail-we0-f179.google.com with SMTP id t60so6573482wes.10 for ; Tue, 02 Sep 2014 01:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wso2.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=te8lg311ssQXbU06duQJ2E8Vs8p5e0Ab7X4b0snRK/g=; b=WAomTcTxJneuJD8ZVdwFL2gTwOriEd3nhljDaFWzSwJx6B/bmONSQaWqeBeUW0/3b/ 3L2jNvtKPcVGfT/hoiCMQzHGoQ4Z3PUrPbI8PFyPCyrziZiTtg+kY9pTdXQFOThUcXpa ojeBknl8kguT/W5E5zReyNaAhc0EYVShl0XmU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=te8lg311ssQXbU06duQJ2E8Vs8p5e0Ab7X4b0snRK/g=; b=Oa6u6t5Es0UzVmFgcQrUaG0Z6Jw58W3moAvPCnP9b4I2a9jrMlsvA2kO0US6od5eqw nsjIB8xBDWKX2+i5X9Xbs+lEwoKpPDt/PfOUGMob/tbcUCkmR2YckJTVKNh2Xk2dzIpl zCfZYm1f9c3/MEM7z2ItIwGWDDGlD+vqOFt8qUrO6NcDvAiHkpLaysmXkZpKg4wXfnQz frhO5XWAsvKPg8HuBzcD+xeV26w2AHh9EK0h/g9vkexsK/+3ChSHQubvErKaAAIOnf/w wwxLFsMdh1LdeO7/Q7ndgvXyJLbzs8XPRQoy02aSGR93FR3HKk74Myz0WfKvVa0itiZ7 buPg== X-Gm-Message-State: ALoCoQloRpFD/h8Dd6JggrWHR4D/bBaASUer78w8DDgZ09SoFcLPxXfTz1VsoCbjSFNmWOS8QNDN X-Received: by 10.180.78.100 with SMTP id a4mr26694093wix.36.1409647602306; Tue, 02 Sep 2014 01:46:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.45.195 with HTTP; Tue, 2 Sep 2014 01:46:22 -0700 (PDT) In-Reply-To: References: From: Dinesh Bandara Date: Tue, 2 Sep 2014 14:16:22 +0530 Message-ID: Subject: Re: Messaging protocol with Stratos python cartridge agent To: dev Content-Type: multipart/alternative; boundary=f46d043890eb982da0050211287a X-Virus-Checked: Checked by ClamAV on apache.org --f46d043890eb982da0050211287a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable We can use custom JSON serializer, deserializer from Stratos end to avoid the message header. On Tue, Sep 2, 2014 at 2:14 PM, Gayan Gunarathne wrote: > Hi Paul, > > Please find the example of existing message header and body.AFAIK > "event-class-name" is the header value used for distinguish the messages. > > header: key expires , value 0 > header: key timestamp , value 1409646637558 > header: key destination , value /topic/topology > header: key persistent , value true > header: key priority , value 4 > header: key event-class-name , value > org.apache.stratos.messaging.event.topology.CompleteTopologyEvent > > Message body: > > {"topology":{"serviceMap":{"gateway":{"serviceName":"gateway","serviceTy= pe":"SingleTenant","clusterIdClusterMap":{"gatewaygateway.am.wso2.com.dom":= {"serviceName":"gateway","clusterId":"gatewaygateway.am.wso2.com.dom","auto= scalePolicyName":"auto-scl-pol1","deploymentPolicyName":" > dep-pol1","hostNames":["foo.org"],"tenantRange":"1-*","isLbCluster":false= ,"memberMap":{"gatewaygateway.am.wso2.com.dom-member-2":{"serviceName":"gat= eway","clusterId":"gatewaygateway.am.wso2.com.dom","networkPartitionId":"ne= twork-partition1","partitionId":"cloud-partition1","memberId":"gatewaygatew= ay.am.wso2.com.dom-member-2","portMap":{"9080":{"protocol":"http","value":8= 080,"proxy":9080}},"memberPublicIp":"127.0.0.1 > public","status":"Activated","memberIp":"127.0.0.1 > private","properties":{"mykey1xxxxxxxxx":"myvalweccccccccccccccc"}},"gate= waygateway.am.wso2.com.dom-member-1":{"serviceName":"gateway","clusterId":"= gatewaygateway.am.wso2.com.dom","networkPartitionId":"network-partition1","= partitionId":"cloud-partition1","memberId":"gatewaygateway.am.wso2.com.dom-= member-1","portMap":{"9080":{"protocol":"http","value":8080,"proxy":9080}},= "memberPublicIp":"127.0.0.1 > public","status":"Activated","memberIp":"127.0.0.1 > private","properties":{"mykey1xxxxxxxxx":"myvalweccccccccccccccc"}},"gate= waygateway.am.wso2.com.dom5863cf8d-2746-4be1-91e9-da98c2bcb5a9":{"serviceNa= me":"gateway","clusterId":"gatewaygateway.am.wso2.com.dom","networkPartitio= nId":"network-partition1","partitionId":"cloud-partition1","memberId":"gate= waygateway.am.wso2.com.dom5863cf8d-2746-4be1-91e9-da98c2bcb5a9","portMap":{= },"memberPublicIp":"public > IP","memberIp":"private > IP"},"lb-member-id-1":{"serviceName":"lb","clusterId":"lbisuruh.lk.domain= ","networkPartitionId":"network-partition1","partitionId":"cloud-partition1= ","memberId":"lb-member-id-1","portMap":{},"memberPublicIp":"public > IP of apistore","memberIp":"private IP of > apistore"}},"properties":{"mykey1weeee":"myvalweeeeeeeee1","mykey1ttttttt= t":"myvalweetttttttttttt1"}}},"portMap":{"9080":{"protocol":"http","value":= 8080,"proxy":9080}},"properties":{"mykey1weeee":"myvalweeeeeeeee1","mykey1t= ttttttt":"myvalweetttttttttttt1"}},"apistore":{"serviceName":"apistore","se= rviceType":"SingleTenant","clusterIdClusterMap":{"apistorestore.am.wso2.com= .doma":{"serviceName":"apistore","clusterId":"apistorestore.am.wso2.com.dom= a","autoscalePolicyName":"auto-scl-pol1","deploymentPolicyName":" > dep-pol1","hostNames":["foo.org"],"tenantRange":"1-*","isLbCluster":false= ,"memberMap":{"apistorestore.am.wso2.com.doma298e2959-a3b4-45a0-a11f-767160= 6158ed":{"serviceName":"apistore","clusterId":"apistorestore.am.wso2.com.do= ma","networkPartitionId":"network-partition1","partitionId":"cloud-partitio= n1","memberId":"apistorestore.am.wso2.com.doma298e2959-a3b4-45a0-a11f-76716= 06158ed","portMap":{},"memberPublicIp":"pub > ip","status":"Activated","memberIp":"ip","lbClusterId":"lbmongolb59422413= 1.mongolb.dom"}}}},"portMap":{"9080":{"protocol":"http","value":8080,"proxy= ":9080}}},"lb":{"serviceName":"lb","serviceType":"SingleTenant","clusterIdC= lusterMap":{"lbisuruh.lk.domain":{"serviceName":"lb","clusterId":"lbisuruh.= lk.domain","autoscalePolicyName":"auto-scl-pol1","deploymentPolicyName":" > dep-pol1","hostNames":["foo.org > "],"tenantRange":"1-*","isLbCluster":false,"memberMap":{}}},"portMap":{"9= 080":{"protocol":"http","value":8080,"proxy":9080}}}},"initialized":false}} > > > Thanks, > Gayan > > > > On Tue, Sep 2, 2014 at 1:49 PM, Paul Fremantle wrote: > >> Can you post an example of the headers and body? >> >> Paul >> >> >> On 2 September 2014 09:17, Gayan Gunarathne wrote: >> >>> Hi Paul, >>> >>> Currently we have existing java based message publisher with the >>> headers. Here we try to use those published messages with the python >>> client. If we use JSON structured message with headers enclosed we hav= e to >>> change all other current implementations as well. AFAIK We will >>> distinguished the messages with their header value.So my point is if we >>> used this sort of JSON structure for messages, we need to change all th= e >>> current messaging model. >>> >>> OTOH with the Stomp protocol with python client we were able to get >>> those header values and used those messages as it is. >>> >>> Thanks, >>> Gayan >>> >>> >>> On Tue, Sep 2, 2014 at 1:04 PM, Paul Fremantle wrote: >>> >>>> What headers do you need to pass? >>>> >>>> The way of doing headers with MQTT is to use a structured message (e.g= . >>>> JSON) and put some headers into the JSON. >>>> >>>> Paul >>>> >>>> >>>> On 2 September 2014 07:58, Gayan Gunarathne wrote: >>>> >>>>> >>>>> We did some analysis regarding the MQTT protocol as well.Following ar= e >>>>> our findings regarding the MQTT. >>>>> >>>>> MQTT is low bandwidth consumption messaging protocol which >>>>> supports pub/sub protocol with the following limitations. >>>>> >>>>> - It has fixed header (2 bytes) . Specifications mentioning that >>>>> it can be extended.But AFAIU clients[1] didn't support for this he= ader >>>>> extension. We have checked the MQTT with the messages published wi= th >>>>> headers and we didn't receive the header on those.Only receive the= message >>>>> body. >>>>> - The payload size for a MQTT message is 256MB.I guess design >>>>> point for MQTT usage is targeted at more constrained devices.[3]. = MQTT is >>>>> better at a high volume of low size messages. >>>>> - It is supports only topic.This will not be a issue currently in >>>>> our scenario as we used only topic currently AFAIK.[4] >>>>> >>>>> >>>>> I guess it build with above limitations and it is very good choice fo= r >>>>> the mobile and small application as it is very lightweight and low >>>>> power.[5] WDYT? >>>>> >>>>> Please share your thoughts on this. >>>>> >>>>> [1] https://pypi.python.org/pypi/paho-mqtt >>>>> [2[ https://github.com/iwanbk/nyamuk >>>>> [3] http://stephendnicholas.com/archives/1217 >>>>> [4] http://www.mqtechconference.com/sessions_v2013/MQTC_v2013_MQTT.pd= f >>>>> [5] >>>>> http://blogs.vmware.com/vfabric/2013/02/choosing-your-messaging-proto= col-amqp-mqtt-or-stomp.html >>>>> >>>>> >>>>> Thanks, >>>>> Gayan >>>>> >>>>> >>>>> On Mon, Sep 1, 2014 at 4:32 PM, Gayan Gunarathne >>>>> wrote: >>>>> >>>>>> Thanks Paul. >>>>>> >>>>>> We will check on this paho-mgtt python library as well. >>>>>> >>>>>> Thanks, >>>>>> Gayan >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Mon, Sep 1, 2014 at 4:17 PM, Paul Fremantle wrote= : >>>>>> >>>>>>> Python has excellent pure python MQTT support. >>>>>>> >>>>>>> > pip install paho-mqtt >>>>>>> >>>>>>> https://pypi.python.org/pypi/paho-mqtt >>>>>>> >>>>>>> Paul >>>>>>> >>>>>>> >>>>>>> On 1 September 2014 11:40, Gayan Gunarathne wrote= : >>>>>>> >>>>>>>> Hi Paul, >>>>>>>> >>>>>>>> Here we try to connect the our existing Apache ActiveMQ with the >>>>>>>> pure python.(We try to replace our java cartridge agent with the >>>>>>>> python as after that we can remove the java dependency from the ca= rtridge >>>>>>>> itself). >>>>>>>> In the initial research we didn't notice such a pure python >>>>>>>> libraries with the MQTT which can connect with the ActiveMQ. Also= with the >>>>>>>> initial reading I guess they are recommend it for the mobile appli= cations >>>>>>>> as its low bandwidth consumption.Also I am noticed lot of web sock= et based >>>>>>>> applications are developed through MQTT. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Gayan >>>>>>>> >>>>>>>> >>>>>>>> On Mon, Sep 1, 2014 at 3:42 PM, Paul Fremantle >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Have you looked at mqtt? >>>>>>>>> >>>>>>>>> Paul >>>>>>>>> On 1 Sep 2014 12:10, "Gayan Gunarathne" wrote: >>>>>>>>> >>>>>>>>>> >>>>>>>>>> Hi All, >>>>>>>>>> >>>>>>>>>> As per our initial research on the python based messaging >>>>>>>>>> implementation of python cartridge agent and discussion[1] we ca= n summarize >>>>>>>>>> our findings as following. >>>>>>>>>> >>>>>>>>>> *1.AMQP* >>>>>>>>>> >>>>>>>>>> Apache ActiveMQ used the AMQP 1.0 protocol. We found C based >>>>>>>>>> client library (proton) [2] which can be used with python. >>>>>>>>>> But it is a platform dependent library and every time we need to >>>>>>>>>> install the libraries based on the architecture and OS version.I= MO this >>>>>>>>>> will be difficult us to manage as we need to install the librari= es based on >>>>>>>>>> the platform. >>>>>>>>>> >>>>>>>>>> Other python libraries(txAMQP ,pika etc) supports AMQP 0.9 which >>>>>>>>>> fails to connect with the ActiveMQ. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> *2.STOMP* >>>>>>>>>> >>>>>>>>>> We can connect to the ActiveMQ with the STOMP protocol by using >>>>>>>>>> the STOMP python client library[3].IMO we can used STOMP with Ac= tiveMQ >>>>>>>>>> without worry about the platform based library installation.By c= onsidering >>>>>>>>>> our scope of the cartridge agent I think it is better to have a = platform >>>>>>>>>> independence cartridge as far as we can. Then, IMO STOMP based m= essaging >>>>>>>>>> queue implementation will be more manageable when we increase o= ur number >>>>>>>>>> of platform supported. >>>>>>>>>> WDYT? >>>>>>>>>> >>>>>>>>>> When comparing the performance of theses two protocols it looks >>>>>>>>>> like there are no such huge difference[4].I guess the performanc= e also >>>>>>>>>> tightly coupled with the message broker you are using as well.OT= OH Apache >>>>>>>>>> ActiveMQ recommended way also to used the STOMP with the python[= 5]. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Please share your thoughts on this. >>>>>>>>>> >>>>>>>>>> [1] Stratos Python Cartridge Agent >>>>>>>>>> [2] https://github.com/apache/qpid-proton >>>>>>>>>> [3] https://github.com/jasonrbriggs/stomp.py >>>>>>>>>> [4] >>>>>>>>>> http://blogs.vmware.com/vfabric/2013/02/choosing-your-messaging-= protocol-amqp-mqtt-or-stomp.html >>>>>>>>>> [5] http://activemq.apache.org/python.html >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> Gayan >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Gayan Gunarathne >>>>>>>>>> Technical Lead >>>>>>>>>> WSO2 Inc. (http://wso2.com) >>>>>>>>>> email : gayang@wso2.com | mobile : +94 766819985 >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Best Regards, >>>>>>>> >>>>>>>> Gayan Gunarathne >>>>>>>> Technical Lead >>>>>>>> WSO2 Inc. (http://wso2.com) >>>>>>>> email : gayang@wso2.com | mobile : +94 766819985 >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Paul Fremantle >>>>>>> CTO and Co-Founder, WSO2 >>>>>>> OASIS WS-RX TC Co-chair, Apache Member >>>>>>> >>>>>>> UK: +44 207 096 0336 >>>>>>> >>>>>>> blog: http://pzf.fremantle.org >>>>>>> twitter.com/pzfreo >>>>>>> paul@wso2.com >>>>>>> >>>>>>> wso2.com Lean Enterprise Middleware >>>>>>> >>>>>>> Disclaimer: This communication may contain privileged or other >>>>>>> confidential information and is intended exclusively for the addres= see/s. >>>>>>> If you are not the intended recipient/s, or believe that you may ha= ve >>>>>>> received this communication in error, please reply to the sender in= dicating >>>>>>> that fact and delete the copy you received and in addition, you sho= uld not >>>>>>> print, copy, retransmit, disseminate, or otherwise use the informat= ion >>>>>>> contained in this communication. Internet communications cannot be >>>>>>> guaranteed to be timely, secure, error or virus-free. The sender do= es not >>>>>>> accept liability for any errors or omissions. >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Best Regards, >>>>>> >>>>>> Gayan Gunarathne >>>>>> Technical Lead >>>>>> WSO2 Inc. (http://wso2.com) >>>>>> email : gayang@wso2.com | mobile : +94 766819985 >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Best Regards, >>>>> >>>>> Gayan Gunarathne >>>>> Technical Lead >>>>> WSO2 Inc. (http://wso2.com) >>>>> email : gayang@wso2.com | mobile : +94 766819985 >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> Paul Fremantle >>>> CTO and Co-Founder, WSO2 >>>> OASIS WS-RX TC Co-chair, Apache Member >>>> >>>> UK: +44 207 096 0336 >>>> >>>> blog: http://pzf.fremantle.org >>>> twitter.com/pzfreo >>>> paul@wso2.com >>>> >>>> wso2.com Lean Enterprise Middleware >>>> >>>> Disclaimer: This communication may contain privileged or other >>>> confidential information and is intended exclusively for the addressee= /s. >>>> If you are not the intended recipient/s, or believe that you may have >>>> received this communication in error, please reply to the sender indic= ating >>>> that fact and delete the copy you received and in addition, you should= not >>>> print, copy, retransmit, disseminate, or otherwise use the information >>>> contained in this communication. Internet communications cannot be >>>> guaranteed to be timely, secure, error or virus-free. The sender does = not >>>> accept liability for any errors or omissions. >>>> >>> >>> >>> >>> -- >>> Best Regards, >>> >>> Gayan Gunarathne >>> Technical Lead >>> WSO2 Inc. (http://wso2.com) >>> email : gayang@wso2.com | mobile : +94 766819985 >>> >>> >> >> >> >> -- >> Paul Fremantle >> CTO and Co-Founder, WSO2 >> OASIS WS-RX TC Co-chair, Apache Member >> >> UK: +44 207 096 0336 >> >> blog: http://pzf.fremantle.org >> twitter.com/pzfreo >> paul@wso2.com >> >> wso2.com Lean Enterprise Middleware >> >> Disclaimer: This communication may contain privileged or other >> confidential information and is intended exclusively for the addressee/s= . >> If you are not the intended recipient/s, or believe that you may have >> received this communication in error, please reply to the sender indicat= ing >> that fact and delete the copy you received and in addition, you should n= ot >> print, copy, retransmit, disseminate, or otherwise use the information >> contained in this communication. Internet communications cannot be >> guaranteed to be timely, secure, error or virus-free. The sender does no= t >> accept liability for any errors or omissions. >> > > > > -- > Best Regards, > > Gayan Gunarathne > Technical Lead > WSO2 Inc. (http://wso2.com) > email : gayang@wso2.com | mobile : +94 766819985 > > --=20 *Dinesh Bandara* Software Engineer WSO2 Inc.; http://wso2.com lean.enterprise.middleware --f46d043890eb982da0050211287a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
We can use custom JSON serializer, deserializer from Strat= os end to avoid the message header.

On Tue, Sep 2, 2014 at 2:14 PM, Gayan Gunarathn= e <gayang@wso2.com> wrote:
Hi Paul,
Please find the example of existing message header and body.AFA= IK "event-class-name" is the header value used for distinguish th= e messages.

header: key expires , value 0
header: key timestamp , v= alue 1409646637558
header: key destination , value /topic/topolog= y
header: key persistent , value true
header: key prior= ity , value 4
header: key event-class-name , value org.apache.stratos.messaging.even= t.topology.CompleteTopologyEvent

Messag= e body:

=C2=A0{"topology":{"service= Map":{"gateway":{"serviceName":"gateway"= ,"serviceType":"SingleTenant","clusterIdClusterMap= ":{"gatewaygateway.am.wso2.com.dom":{"serviceName"= :"gateway","clusterId":"gatewaygateway.am.wso2.com= .dom","autoscalePolicyName":"auto-scl-pol1","= deploymentPolicyName":" dep-pol1","hostNames":[&qu= ot;foo.org"],"te= nantRange":"1-*","isLbCluster":false,"memberM= ap":{"gatewaygateway.am.wso2.com.dom-member-2":{"servic= eName":"gateway","clusterId":"gatewaygateway.= am.wso2.com.dom","networkPartitionId":"network-partitio= n1","partitionId":"cloud-partition1","memberI= d":"gatewaygateway.am.wso2.com.dom-member-2","portMap&q= uot;:{"9080":{"protocol":"http","value&q= uot;:8080,"proxy":9080}},"memberPublicIp":"127.0.0= .1 public","status":"Activated","memberIp&quo= t;:"127.0.0.1 private","properties":{"mykey1xxxxxx= xxx":"myvalweccccccccccccccc"}},"gatewaygateway.am.wso2= .com.dom-member-1":{"serviceName":"gateway","= clusterId":"gatewaygateway.am.wso2.com.dom","networkPar= titionId":"network-partition1","partitionId":"= ;cloud-partition1","memberId":"gatewaygateway.am.wso2.c= om.dom-member-1","portMap":{"9080":{"protocol= ":"http","value":8080,"proxy":9080}},&qu= ot;memberPublicIp":"127.0.0.1 public","status":&qu= ot;Activated","memberIp":"127.0.0.1 private","= ;properties":{"mykey1xxxxxxxxx":"myvalweccccccccccccccc= "}},"gatewaygateway.am.wso2.com.dom5863cf8d-2746-4be1-91e9-da98c2= bcb5a9":{"serviceName":"gateway","clusterId&q= uot;:"gatewaygateway.am.wso2.com.dom","networkPartitionId&qu= ot;:"network-partition1","partitionId":"cloud-part= ition1","memberId":"gatewaygateway.am.wso2.com.dom5863c= f8d-2746-4be1-91e9-da98c2bcb5a9","portMap":{},"memberPu= blicIp":"public IP","memberIp":"private IP&qu= ot;},"lb-member-id-1":{"serviceName":"lb",&qu= ot;clusterId":"lbisuruh.lk.domain","networkPartitionId&= quot;:"network-partition1","partitionId":"cloud-pa= rtition1","memberId":"lb-member-id-1","portMa= p":{},"memberPublicIp":"public IP of apistore",&qu= ot;memberIp":"private IP of apistore"}},"properties&quo= t;:{"mykey1weeee":"myvalweeeeeeeee1","mykey1tttttt= tt":"myvalweetttttttttttt1"}}},"portMap":{"90= 80":{"protocol":"http","value":8080,&quo= t;proxy":9080}},"properties":{"mykey1weeee":"= myvalweeeeeeeee1","mykey1tttttttt":"myvalweettttttttttt= t1"}},"apistore":{"serviceName":"apistore&quo= t;,"serviceType":"SingleTenant","clusterIdClusterM= ap":{"apistorestore.am.wso2.com.doma":{"serviceName&quo= t;:"apistore","clusterId":"apistorestore.am.wso2.c= om.doma","autoscalePolicyName":"auto-scl-pol1",&qu= ot;deploymentPolicyName":" dep-pol1","hostNames":[= "foo.org"],"= ;tenantRange":"1-*","isLbCluster":false,"memb= erMap":{"apistorestore.am.wso2.com.doma298e2959-a3b4-45a0-a11f-76= 71606158ed":{"serviceName":"apistore","cluste= rId":"apistorestore.am.wso2.com.doma","networkPartition= Id":"network-partition1","partitionId":"cloud= -partition1","memberId":"apistorestore.am.wso2.com.doma= 298e2959-a3b4-45a0-a11f-7671606158ed","portMap":{},"mem= berPublicIp":"pub ip","status":"Activated&quo= t;,"memberIp":"ip","lbClusterId":"lbmong= olb594224131.mongolb.dom"}}}},"portMap":{"9080":{&= quot;protocol":"http","value":8080,"proxy&quo= t;:9080}}},"lb":{"serviceName":"lb","ser= viceType":"SingleTenant","clusterIdClusterMap":{&q= uot;lbisuruh.lk.domain":{"serviceName":"lb","= clusterId":"lbisuruh.lk.domain","autoscalePolicyName&qu= ot;:"auto-scl-pol1","deploymentPolicyName":" dep-p= ol1","hostNames":["foo.org"],"tenantRange":"1-*","i= sLbCluster":false,"memberMap":{}}},"portMap":{&quo= t;9080":{"protocol":"http","value":8080,= "proxy":9080}}}},"initialized":false}}


Thanks,
Gayan
=


On Tue, Sep 2, 2014 at 1:49 PM, = Paul Fremantle <paul@wso2.com> wrote:
Can you post an example of = the headers and body?

Paul

On 2 September 2014 09:17, Gayan Gunarathne= <gayang@wso2.com> wrote:
Hi Paul,
Currently we have existing java based message publisher with th= e headers. Here we try to use those published messages with the python clie= nt. If we use JSON structured message with =C2=A0headers enclosed we have t= o change all other current implementations as well. AFAIK We will distingui= shed the messages with their header value.So my point is if we used this so= rt of JSON structure for messages, we need to change all the current messag= ing model.

OTOH with the Stomp protocol with python client we were able= to get those header values and used those messages as it is.=C2=A0

Thanks,
Gayan


On Tue, Sep 2, 2014 at 1:04 PM, Paul Fre= mantle <paul@wso2.com> wrote:
What headers do you need to pass?

The w= ay of doing headers with MQTT is to use a structured message (e.g. JSON) an= d put some headers into the JSON.

Paul


On 2 September 2014 07:58, Gayan Gunarat= hne <gayang@wso2.com> wrote:

We did some analysis regarding the MQTT protocol = as well.Following are our findings regarding the MQTT.

=
MQTT is low bandwidth consumption messaging protocol which supports=C2= =A0pub/sub protocol=C2=A0with the following limitations.=C2=A0
  • It has fixed header (2 bytes) . Specifications mentioning that= it can be extended.But AFAIU clients[1] didn't support for this header= extension. We have checked the MQTT with the messages published with heade= rs and we didn't receive the header on those.Only receive the message b= ody.
  • The payload size for a MQTT message is 256MB.I guess design point for M= QTT usage is targeted at more constrained devices.[3]. MQTT is better at a = high volume of low size messages.
  • It is supports only topic.Thi= s will not be a issue currently in our scenario as we used only topic curre= ntly AFAIK.[4]

I guess it build with above limitations= and it is very good choice for the mobile and small application as it=C2=A0is ver= y lightweight and low power.[5] WDYT?
Please share your thoughts on this.
[3]=C2=A0http://stephendnich= olas.com/archives/1217


On Mon, Sep 1, 2014 at 4:32 PM, Gayan Gunarathne <gayang@wso2.com> wrote:
Thanks Paul.

=
We will check on this paho-mgtt python library as well.

=
Thanks,
Gayan


=


On Mon, Sep 1, 2014 at 4:17 PM, Paul Fremant= le <paul@wso2.com> wrote:
Python has excellent pure python MQTT support.=C2=A0
<= br>
>=C2=A0pip install paho-mqtt


Paul


On = 1 September 2014 11:40, Gayan Gunarathne <gayang@wso2.com> wro= te:
Hi Paul,

Here we try to conn= ect the our existing Apache ActiveMQ with the pure python.(We try to replace our java cart= ridge agent with the python as after that we can remove the java dependency= from the cartridge itself).=C2=A0
In the initial research we didn't notice such a pure python librar= ies with the MQTT=C2=A0=C2=A0which can connect with the ActiveMQ. Also with= the initial reading I guess they are recommend it for the mobile applicati= ons as its low bandwidth consumption.Also I am noticed lot of web socket ba= sed applications are developed through MQTT.

Thanks,
Gayan


On Mon, Sep 1, 2014 at = 3:42 PM, Paul Fremantle <paul@wso2.com> wrote:

Have you looked at mqtt?

<= span>

Paul

On 1 Sep 2014 12:10, "Gayan Gunarathne"= ; <gayang@wso2.com<= /a>> wrote:

Hi All,

As pe= r our initial research on the python based messaging implementation of pyth= on cartridge agent and discussion[1] we can summarize our findings as follo= wing.

1.AMQP

Apache ActiveMQ = used the AMQP 1.0 protocol. We found C based client library (proton) [2] wh= ich can be used with python.
But it is a platform dependent libra= ry and every time we need to install the libraries based on the architectur= e and OS version.IMO this will be difficult us to manage as we need to inst= all the libraries based on the platform.

Other python libraries(txAMQP ,pika etc)=C2=A0= supports AMQP 0.9 which fails to connect with the ActiveMQ.

<= /div>

2.STOMP

We can connect = to the ActiveMQ with the STOMP protocol by using the STOMP python client li= brary[3].IMO we can used STOMP with ActiveMQ without worry about the platfo= rm based library installation.By considering our scope of the cartridge age= nt I think it is better to have a platform independence cartridge as far as= we can. Then, IMO STOMP based messaging queue implementation =C2=A0will be= more manageable when we increase our number of platform supported.
WDYT?

When comparing the performance of these= s two protocols it looks like there are no such huge difference[4].I guess = the performance also tightly coupled with the message broker you are using = as well.OTOH Apache ActiveMQ recommended way also to used the STOMP with th= e python[5].


Please share your thoughts on this.

[1]=C2=A0Stratos Python Cartridge Agent
[4]=C2=A0http://blogs.vmware.com/v= fabric/2013/02/choosing-your-messaging-protocol-amqp-mqtt-or-stomp.html=

=
Thanks,
Gayan



--


Gayan Gunarathne
=
Technical Lead
WSO2 Inc. (http://wso2.com)
=
= email=C2=A0 : gayang@wso2.com=C2=A0 | mobile = : +94 766819985
=C2=A0




<= /div>--
Best Regards,

G= ayan Gunarathne
Technical Lead<= br>
WSO2 Inc. (http://wso2.com)
=
=
email=C2=A0 : gayang@wso2.com=C2=A0 | mo= bile : +94 766819985<= /span>
=C2=A0




--
=
Paul Fremantle
CTO and Co-Founder, WSO2
OASIS WS-RX = TC Co-chair, Apache Member

UK: +44 207 096 0336=

blog: http://pzf= .fremantle.org
twitter.com/pzfreo<= /a>
paul@wso2.com=




--



--
=
Best Re= gards,

Gayan Gunarathne
Technical Lead
= email=C2=A0 : gayang@wso2.com=C2=A0 | mobile = : +94 766819985
=C2=A0




--
=
Paul Fremantle
CTO and Co-Founder, WSO2
OASIS WS-RX = TC Co-chair, Apache Member

UK: +44 207 096 0336=

blog: http://pzf.fre= mantle.org
t= witter.com/pzfreo
paul@wso2.com

wso2.com L= ean Enterprise Middleware

Disclaimer: This communication may contain= privileged or other confidential information and is intended exclusively f= or the addressee/s. If you are not the intended recipient/s, or believe tha= t you may have received this communication in error, please reply to the se= nder indicating that fact and delete the copy you received and in addition,= you should not print, copy, retransmit, disseminate, or otherwise use the = information contained in this communication. Internet communications cannot= be guaranteed to be timely, secure, error or virus-free. The sender does n= ot accept liability for any errors or omissions.



--
=
Best Re= gards,

Gayan Gunarathne
Technical Lead
= email=C2=A0 : gayang@wso2.com=C2=A0 | mobile = : +94 766819985
=C2=A0




--
=
Paul Fremantle
CTO and Co-Founder, WSO2
OASIS WS-RX = TC Co-chair, Apache Member

UK: +44 207 096 0336=

blog: http://pzf.fre= mantle.org
t= witter.com/pzfreo
paul@wso2.com

wso2.com L= ean Enterprise Middleware

Disclaimer: This communication may contain= privileged or other confidential information and is intended exclusively f= or the addressee/s. If you are not the intended recipient/s, or believe tha= t you may have received this communication in error, please reply to the se= nder indicating that fact and delete the copy you received and in addition,= you should not print, copy, retransmit, disseminate, or otherwise use the = information contained in this communication. Internet communications cannot= be guaranteed to be timely, secure, error or virus-free. The sender does n= ot accept liability for any errors or omissions.



--
=
Best Re= gards,

Gayan Gunarathne
Technical Lead
= email=C2=A0 : gayang@wso2.com=C2=A0 | mobile = : +94 766819985
=C2=A0




--
Dinesh Bandara
Softwar= e Engineer
WSO2 In= c.;=C2=A0http://wso2.com
l= ean.enterprise.middleware

--f46d043890eb982da0050211287a--