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 DBF0F200B87 for ; Mon, 19 Sep 2016 17:30:15 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DA8F5160ACC; Mon, 19 Sep 2016 15:30:15 +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 F09B6160ABB for ; Mon, 19 Sep 2016 17:30:14 +0200 (CEST) Received: (qmail 94617 invoked by uid 500); 19 Sep 2016 15:30:14 -0000 Mailing-List: contact dev-help@edgent.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@edgent.apache.org Delivered-To: mailing list dev@edgent.apache.org Received: (qmail 94605 invoked by uid 99); 19 Sep 2016 15:30:13 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Sep 2016 15:30:13 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 7DB341A5E26 for ; Mon, 19 Sep 2016 15:30:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 5QwHRa9uqdob for ; Mon, 19 Sep 2016 15:30:09 +0000 (UTC) Received: from mail-qk0-f179.google.com (mail-qk0-f179.google.com [209.85.220.179]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 8FA125FD84 for ; Mon, 19 Sep 2016 15:30:09 +0000 (UTC) Received: by mail-qk0-f179.google.com with SMTP id n185so13270087qke.1 for ; Mon, 19 Sep 2016 08:30:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:message-id:mime-version:subject:date:references:to:in-reply-to; bh=Vk3YKJC1eEF6xJqbl7FduQ71yDNJAu5xdmpfn4SvEig=; b=orxBuUZ5Ja8gW/V24lMG+kNpT6KU5bgwhS+XUwP7IqlvQR7Ket9M36UHMrcjgcGPqk AG27Z4R/faropJH6xmC1qLIjOT4OBGE5B5CJfccpnUgUdYBBxdjTXnlReCivaZAb6FTl C0dG34sXVeplkt+zgAXCV/5KSEMTnmdLcXThzTjPzN6g6JSlkRX/F7ItvhA6+ncHHdRn J32wS1wQDWWBDTmJnCvcXJtmzZ6lyDyZBT0VkVMJjDr+LCd/pQVTKg3/ItlRYLAt7InF EtUuuW0ohnwxv0b+N2npM0ADDAeZJ4XZWklqrjVyENOqhX0fiuAogBYghwIdZCzGvoTP R6YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:mime-version:subject:date :references:to:in-reply-to; bh=Vk3YKJC1eEF6xJqbl7FduQ71yDNJAu5xdmpfn4SvEig=; b=Dimd1X5TjwiW0ko8/GKKWSWNi+TVNU2G7MBrjC7cdd+VMqnwscduNjUhO/XcfP3vOo 6cOmkKlbZx39dhc6AY9run4oVIMyQvXfTovlrfc1p18EUI8pyxyhCxdva14E/wuMvuLt 9ytoBrdo2d7NCgri3l5RtzH/Sru8YzAaIk9kB076HplwpYbP68BT3r9dKddVbu/bdbZs VnHw5i+X8Av99H68f8smZYOEHuimkwefRG12122iD3pCfDYEeUmWS0JJCtvN8AQuKUcG vd0hEX/WtDrFlOer9gViyNmmK9hZq0d5FSym1Jp18VgXh0Hwc5REi70m2fOvzHNE7yxl ecfg== X-Gm-Message-State: AE9vXwOmP0TL/9ZPCN+edIa8vEBZ94LW1zqZpGbE2LBFxc0M2OTmXi3x3HCKl6KdlCHXqg== X-Received: by 10.233.222.69 with SMTP id s66mr32100600qkf.102.1474299008905; Mon, 19 Sep 2016 08:30:08 -0700 (PDT) Received: from dales-mbp.usma.ibm.com ([129.42.208.174]) by smtp.gmail.com with ESMTPSA id i4sm13272594qte.40.2016.09.19.08.30.07 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Sep 2016 08:30:08 -0700 (PDT) From: Dale LaBossiere Content-Type: multipart/alternative; boundary="Apple-Mail=_82453A5D-D587-4C9D-A524-EE9BF14FE175" Message-Id: Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: Trying register an application via the registerJar command Date: Mon, 19 Sep 2016 11:30:05 -0400 References: <66814353-1C7B-4E6F-B398-BED3BF7BD542@pacbell.net> <4cb1f4a7-e300-98dc-5ae4-5d20f0f107cb@debrunners.com> <88E263E5-F417-415F-BB59-88859A18D14B@pacbell.net> <3be9ec9e-2621-9435-0c1d-670a5aa171dc@debrunners.com> <38A15CF7-ADCC-4F29-AC76-0BC424F4AD4B@gmail.com> <26FB740D-685C-48E6-A4F8-3BE8D235D79E@pacbell.net> To: dev@edgent.apache.org In-Reply-To: X-Mailer: Apple Mail (2.2104) archived-at: Mon, 19 Sep 2016 15:30:16 -0000 --Apple-Mail=_82453A5D-D587-4C9D-A524-EE9BF14FE175 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 FYI I just created https://issues.apache.org/jira/browse/EDGENT-250 = to update IotProvider = doc related to registerJar(). You should consider adding commentary = there as part of your experiences =E2=80=94 and/or consider tacking that = jira and maybe even enhancing the doc further in this space :-) =E2=80=94 Dale > On Sep 19, 2016, at 11:07 AM, Dale LaBossiere = wrote: >=20 > The TopologyBuilder.getBuilder() impl is bogus. Looks like it=E2=80=99s= copied from TestApplication(). All it does is return a builder = (BiConsumer) that creates a topology consisting of a TStream = containing one tuple with the app=E2=80=99s name and prints that stream. >=20 > Your getBuilder() impl needs to return a BiConsumer that builds your = app=E2=80=99s topology. Looks like that=E2=80=99s what your accept() is = trying to do. Seems like you want something like (though I=E2=80=99d = rename that accept() to something like =E2=80=9CbuildTopology()=E2=80=9D = for clarity). >=20 > public BiConsumer getBuilder() { > return (t,c) -> accept(t,c); > } =20 >=20 > Fix that and then see what happens regarding handling of the submit = request. You might also consider adding a println to your getBuilder() = and accept() to verify they=E2=80=99re getting called. >=20 > =E2=80=94 Dale >=20 >> On Sep 16, 2016, at 5:44 PM, Susan Cline = wrote: >>=20 >> Thanks Dale. It did not work however, the results are the same after = removing the 3 lines before provider.start(). >> When I submit the SpeedJarApp I can see this in the pi terminal (this = is the full output from when I started the registerJarExample = application to when I submitted the command): >>=20 >> pi@raspberrypi:~/devConf $ java -jar registerJarExample.jar = speed_sensor_config1.txt >> Sep 16, 2016 9:39:08 PM = org.apache.edgent.runtime.appservice.AppService registerTopology >> INFO: Register application name: edgentIotDevicePubSub >> Sep 16, 2016 9:39:08 PM = org.apache.edgent.runtime.appservice.AppService registerTopology >> INFO: Register application name: edgentIotCommandsToControl >> Sep 16, 2016 9:39:08 PM = org.apache.edgent.runtime.appservice.AppService registerTopology >> INFO: Register application name: edgentJobMonitorApp >> false >> Sep 16, 2016 9:39:09 PM pi.RegisterJarExample main >> INFO: Here is some info >> Sep 16, 2016 9:39:09 PM com.ibm.iotf.client.AbstractClient = createClient >> INFO: pool-1-thread-22-edgentIotDevicePubSub: Org ID =3D ni6dcf >> Client ID =3D d:ni6dcf:SpeedSensor:Pi3_SpeedSensor_1 >> Sep 16, 2016 9:39:09 PM com.ibm.iotf.client.AbstractClient connect >> INFO: pool-1-thread-22-edgentIotDevicePubSub: Connecting client = d:ni6dcf:SpeedSensor:Pi3_SpeedSensor_1 to = ssl://ni6dcf.messaging.internetofthings.ibmcloud.com:8883 (attempt = #1)... >> Sep 16, 2016 9:39:10 PM com.ibm.iotf.client.AbstractClient connect >> INFO: pool-1-thread-22-edgentIotDevicePubSub: Successfully connected = to the IBM Watson IoT Platform >> Sep 16, 2016 9:39:49 PM = org.apache.edgent.runtime.appservice.AppService registerJar >> INFO: Register jar: file:///home/pi/devConf/pi.sensors.jar >> Sep 16, 2016 9:39:49 PM = org.apache.edgent.runtime.appservice.AppService registerJar >> INFO: about to call registerTopology >> Sep 16, 2016 9:39:49 PM = org.apache.edgent.runtime.appservice.AppService registerTopology >> INFO: Register application name: SpeedJarApp >> SpeedJarApp >> Sep 16, 2016 9:40:11 PM org.apache.edgent.runtime.etiao.Executable$1 = accept >> INFO: No more active user tasks >>=20 >> Thanks, >>=20 >> Susan >>=20 >>=20 >>=20 >>> On Sep 16, 2016, at 10:32 AM, Dale LaBossiere = wrote: >>>=20 >>> I haven=E2=80=99t digested the complete email message yet, but try = removing those three lines before provider.start() and try again. >>> IotProvider already create/registers those services (described in = its javadoc). I guess I wouldn=E2=80=99t be surprised if these extra = additions might much things up. >>>=20 >>> =E2=80=94 Dale >>>=20 >>>> On Sep 16, 2016, at 1:17 PM, Susan Cline = wrote: >>>>=20 >>>> I=E2=80=99ve gotten a step further, but I am still having problems. >>>> ... >>>>=20 >>>> public class RegisterJarExample { >>>> IotProvider provider =3D new IotProvider(topology -> new = IotpDevice(topology, configFile)); >>>> /* >>>> * Not sure if I need the next few lines or not ... >>>> */ >>>> JsonControlService control =3D new JsonControlService(); >>>> provider.getServices().addService(ControlService.class, = control);=20 >>>> ApplicationService appService =3D = AppService.createAndRegister(provider, provider); >>>> provider.start(); >>>> =09 >>>> logger.info("Here is some info"); >>>> } >>>> =09 >>>> } >>>=20 >>=20 >=20 --Apple-Mail=_82453A5D-D587-4C9D-A524-EE9BF14FE175--