You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by Andy Grebe <an...@gmail.com> on 2022/05/25 13:57:49 UTC

Subscription Simulation

From the Getting Started guide,  So if a protocol doesn’t support
subscription based communication it is our goal to simulate this by polling
in the background so it is transparent for the users.

Has this been implemented for any of the protocols?

Thanks,
Andy

Re: Subscription Simulation

Posted by Andy Grebe <an...@gmail.com>.
I used the scraper and so far great results!

On Thu, Jun 2, 2022, 1:04 PM Łukasz Dywicki <lu...@code-house.org> wrote:

> FYI, I moved the decorator stuff (as well as osgi related modules) to
> separate repo:
> http://github.com/connectorio/plc4x-extras/
>
> I made first release, so it will be in maven central in coming hours.
>
> You can pull it via maven coordinates:
> <dependency>
>    <groupId>org.connectorio.plc4x.extras</groupId>
>    <artifactId>org.connectorio.plc4x.extras.decorator</artifactId>
>    <version>0.8.0</version>
> </dependency>
>
> Difference between this and scrapper is complexity - scrapper is a
> separate executable while extras I link are supplements to plc4x apis
> which could be embedded in your thing.
>
> Best,
> Łukasz
>
>
> On 1.06.2022 19:24, Andy Grebe wrote:
> > Thanks Ben, I'll check this out.
> >
> > On Sun, May 29, 2022 at 5:46 PM Ben Hutcheson <be...@gmail.com>
> wrote:
> >
> >> Andy, I'm not sure if you're aware but there is a scraper
> >> https://plc4x.apache.org/users/tools/scraper.html which you can use to
> >> continuously poll data even when the driver doesn't support
> subscriptions.
> >>
> >> On Mon, May 30, 2022 at 7:42 AM Łukasz Dywicki <lu...@code-house.org>
> >> wrote:
> >>
> >>> The simulation of subscriptions require probably more options than just
> >>> "event" or so. You probably need to configure higher frequency for
> >>> polling and ideally manage thread pool for that independently from
> >>> netty/connection itself to have control over its reliability.
> >>>
> >>> If I could have one suggestion.. try making it via decoration of
> >>> connection/driver. It gives you most of the flexibility without going
> to
> >>> close with driver.
> >>>
> >>> I made some decorator support earlier. Base structure is here:
> >>>
> >>>
> >>
> https://github.com/ConnectorIO/connectorio-addons/tree/master/bundles/org.connectorio.plc4x.decorator/src/main/java/org/connectorio/plc4x/decorator
> >>> example of "retry" logic for connection read/write/subscribe:
> >>>
> >>>
> >>
> https://github.com/ConnectorIO/connectorio-addons/blob/master/bundles/org.connectorio.plc4x.decorator.retry/src/main/java/org/connectorio/plc4x/decorator/retry/RetryDecorator.java
> >>>
> >>> If you find it useful for your thing we can move it into develop and
> >>> maintain together.
> >>>
> >>> Best,
> >>> Łukasz
> >>>
> >>>
> >>> On 29.05.2022 23:34, Andy Grebe wrote:
> >>>> hmmm...  I should probably push those CIP changes first :)
> >>>>
> >>>> On Wed, May 25, 2022 at 10:14 AM Christofer Dutz <
> >>> christofer.dutz@c-ware.de>
> >>>> wrote:
> >>>>
> >>>>> Hi Andy,
> >>>>>
> >>>>> It still is our plan :-)
> >>>>>
> >>>>> Just nobody did it yet ;-)
> >>>>>
> >>>>> Chris
> >>>>>
> >>>>> -----Original Message-----
> >>>>> From: Andy Grebe <an...@gmail.com>
> >>>>> Sent: Mittwoch, 25. Mai 2022 15:58
> >>>>> To: dev@plc4x.apache.org
> >>>>> Subject: Subscription Simulation
> >>>>>
> >>>>>   From the Getting Started guide,  So if a protocol doesn’t support
> >>>>> subscription based communication it is our goal to simulate this by
> >>> polling
> >>>>> in the background so it is transparent for the users.
> >>>>>
> >>>>> Has this been implemented for any of the protocols?
> >>>>>
> >>>>> Thanks,
> >>>>> Andy
> >>>>>
> >>>>
> >>>
> >>
> >
>

Re: Subscription Simulation

Posted by Łukasz Dywicki <lu...@code-house.org>.
FYI, I moved the decorator stuff (as well as osgi related modules) to 
separate repo:
http://github.com/connectorio/plc4x-extras/

I made first release, so it will be in maven central in coming hours.

You can pull it via maven coordinates:
<dependency>
   <groupId>org.connectorio.plc4x.extras</groupId>
   <artifactId>org.connectorio.plc4x.extras.decorator</artifactId>
   <version>0.8.0</version>
</dependency>

Difference between this and scrapper is complexity - scrapper is a 
separate executable while extras I link are supplements to plc4x apis 
which could be embedded in your thing.

Best,
Łukasz


On 1.06.2022 19:24, Andy Grebe wrote:
> Thanks Ben, I'll check this out.
> 
> On Sun, May 29, 2022 at 5:46 PM Ben Hutcheson <be...@gmail.com> wrote:
> 
>> Andy, I'm not sure if you're aware but there is a scraper
>> https://plc4x.apache.org/users/tools/scraper.html which you can use to
>> continuously poll data even when the driver doesn't support subscriptions.
>>
>> On Mon, May 30, 2022 at 7:42 AM Łukasz Dywicki <lu...@code-house.org>
>> wrote:
>>
>>> The simulation of subscriptions require probably more options than just
>>> "event" or so. You probably need to configure higher frequency for
>>> polling and ideally manage thread pool for that independently from
>>> netty/connection itself to have control over its reliability.
>>>
>>> If I could have one suggestion.. try making it via decoration of
>>> connection/driver. It gives you most of the flexibility without going to
>>> close with driver.
>>>
>>> I made some decorator support earlier. Base structure is here:
>>>
>>>
>> https://github.com/ConnectorIO/connectorio-addons/tree/master/bundles/org.connectorio.plc4x.decorator/src/main/java/org/connectorio/plc4x/decorator
>>> example of "retry" logic for connection read/write/subscribe:
>>>
>>>
>> https://github.com/ConnectorIO/connectorio-addons/blob/master/bundles/org.connectorio.plc4x.decorator.retry/src/main/java/org/connectorio/plc4x/decorator/retry/RetryDecorator.java
>>>
>>> If you find it useful for your thing we can move it into develop and
>>> maintain together.
>>>
>>> Best,
>>> Łukasz
>>>
>>>
>>> On 29.05.2022 23:34, Andy Grebe wrote:
>>>> hmmm...  I should probably push those CIP changes first :)
>>>>
>>>> On Wed, May 25, 2022 at 10:14 AM Christofer Dutz <
>>> christofer.dutz@c-ware.de>
>>>> wrote:
>>>>
>>>>> Hi Andy,
>>>>>
>>>>> It still is our plan :-)
>>>>>
>>>>> Just nobody did it yet ;-)
>>>>>
>>>>> Chris
>>>>>
>>>>> -----Original Message-----
>>>>> From: Andy Grebe <an...@gmail.com>
>>>>> Sent: Mittwoch, 25. Mai 2022 15:58
>>>>> To: dev@plc4x.apache.org
>>>>> Subject: Subscription Simulation
>>>>>
>>>>>   From the Getting Started guide,  So if a protocol doesn’t support
>>>>> subscription based communication it is our goal to simulate this by
>>> polling
>>>>> in the background so it is transparent for the users.
>>>>>
>>>>> Has this been implemented for any of the protocols?
>>>>>
>>>>> Thanks,
>>>>> Andy
>>>>>
>>>>
>>>
>>
> 

Re: Subscription Simulation

Posted by Andy Grebe <an...@gmail.com>.
Thanks Ben, I'll check this out.

On Sun, May 29, 2022 at 5:46 PM Ben Hutcheson <be...@gmail.com> wrote:

> Andy, I'm not sure if you're aware but there is a scraper
> https://plc4x.apache.org/users/tools/scraper.html which you can use to
> continuously poll data even when the driver doesn't support subscriptions.
>
> On Mon, May 30, 2022 at 7:42 AM Łukasz Dywicki <lu...@code-house.org>
> wrote:
>
> > The simulation of subscriptions require probably more options than just
> > "event" or so. You probably need to configure higher frequency for
> > polling and ideally manage thread pool for that independently from
> > netty/connection itself to have control over its reliability.
> >
> > If I could have one suggestion.. try making it via decoration of
> > connection/driver. It gives you most of the flexibility without going to
> > close with driver.
> >
> > I made some decorator support earlier. Base structure is here:
> >
> >
> https://github.com/ConnectorIO/connectorio-addons/tree/master/bundles/org.connectorio.plc4x.decorator/src/main/java/org/connectorio/plc4x/decorator
> > example of "retry" logic for connection read/write/subscribe:
> >
> >
> https://github.com/ConnectorIO/connectorio-addons/blob/master/bundles/org.connectorio.plc4x.decorator.retry/src/main/java/org/connectorio/plc4x/decorator/retry/RetryDecorator.java
> >
> > If you find it useful for your thing we can move it into develop and
> > maintain together.
> >
> > Best,
> > Łukasz
> >
> >
> > On 29.05.2022 23:34, Andy Grebe wrote:
> > > hmmm...  I should probably push those CIP changes first :)
> > >
> > > On Wed, May 25, 2022 at 10:14 AM Christofer Dutz <
> > christofer.dutz@c-ware.de>
> > > wrote:
> > >
> > >> Hi Andy,
> > >>
> > >> It still is our plan :-)
> > >>
> > >> Just nobody did it yet ;-)
> > >>
> > >> Chris
> > >>
> > >> -----Original Message-----
> > >> From: Andy Grebe <an...@gmail.com>
> > >> Sent: Mittwoch, 25. Mai 2022 15:58
> > >> To: dev@plc4x.apache.org
> > >> Subject: Subscription Simulation
> > >>
> > >>  From the Getting Started guide,  So if a protocol doesn’t support
> > >> subscription based communication it is our goal to simulate this by
> > polling
> > >> in the background so it is transparent for the users.
> > >>
> > >> Has this been implemented for any of the protocols?
> > >>
> > >> Thanks,
> > >> Andy
> > >>
> > >
> >
>

Re: Subscription Simulation

Posted by Ben Hutcheson <be...@gmail.com>.
Andy, I'm not sure if you're aware but there is a scraper
https://plc4x.apache.org/users/tools/scraper.html which you can use to
continuously poll data even when the driver doesn't support subscriptions.

On Mon, May 30, 2022 at 7:42 AM Łukasz Dywicki <lu...@code-house.org> wrote:

> The simulation of subscriptions require probably more options than just
> "event" or so. You probably need to configure higher frequency for
> polling and ideally manage thread pool for that independently from
> netty/connection itself to have control over its reliability.
>
> If I could have one suggestion.. try making it via decoration of
> connection/driver. It gives you most of the flexibility without going to
> close with driver.
>
> I made some decorator support earlier. Base structure is here:
>
> https://github.com/ConnectorIO/connectorio-addons/tree/master/bundles/org.connectorio.plc4x.decorator/src/main/java/org/connectorio/plc4x/decorator
> example of "retry" logic for connection read/write/subscribe:
>
> https://github.com/ConnectorIO/connectorio-addons/blob/master/bundles/org.connectorio.plc4x.decorator.retry/src/main/java/org/connectorio/plc4x/decorator/retry/RetryDecorator.java
>
> If you find it useful for your thing we can move it into develop and
> maintain together.
>
> Best,
> Łukasz
>
>
> On 29.05.2022 23:34, Andy Grebe wrote:
> > hmmm...  I should probably push those CIP changes first :)
> >
> > On Wed, May 25, 2022 at 10:14 AM Christofer Dutz <
> christofer.dutz@c-ware.de>
> > wrote:
> >
> >> Hi Andy,
> >>
> >> It still is our plan :-)
> >>
> >> Just nobody did it yet ;-)
> >>
> >> Chris
> >>
> >> -----Original Message-----
> >> From: Andy Grebe <an...@gmail.com>
> >> Sent: Mittwoch, 25. Mai 2022 15:58
> >> To: dev@plc4x.apache.org
> >> Subject: Subscription Simulation
> >>
> >>  From the Getting Started guide,  So if a protocol doesn’t support
> >> subscription based communication it is our goal to simulate this by
> polling
> >> in the background so it is transparent for the users.
> >>
> >> Has this been implemented for any of the protocols?
> >>
> >> Thanks,
> >> Andy
> >>
> >
>

Re: Subscription Simulation

Posted by Łukasz Dywicki <lu...@code-house.org>.
The simulation of subscriptions require probably more options than just 
"event" or so. You probably need to configure higher frequency for 
polling and ideally manage thread pool for that independently from 
netty/connection itself to have control over its reliability.

If I could have one suggestion.. try making it via decoration of 
connection/driver. It gives you most of the flexibility without going to 
close with driver.

I made some decorator support earlier. Base structure is here:
https://github.com/ConnectorIO/connectorio-addons/tree/master/bundles/org.connectorio.plc4x.decorator/src/main/java/org/connectorio/plc4x/decorator
example of "retry" logic for connection read/write/subscribe:
https://github.com/ConnectorIO/connectorio-addons/blob/master/bundles/org.connectorio.plc4x.decorator.retry/src/main/java/org/connectorio/plc4x/decorator/retry/RetryDecorator.java

If you find it useful for your thing we can move it into develop and 
maintain together.

Best,
Łukasz


On 29.05.2022 23:34, Andy Grebe wrote:
> hmmm...  I should probably push those CIP changes first :)
> 
> On Wed, May 25, 2022 at 10:14 AM Christofer Dutz <ch...@c-ware.de>
> wrote:
> 
>> Hi Andy,
>>
>> It still is our plan :-)
>>
>> Just nobody did it yet ;-)
>>
>> Chris
>>
>> -----Original Message-----
>> From: Andy Grebe <an...@gmail.com>
>> Sent: Mittwoch, 25. Mai 2022 15:58
>> To: dev@plc4x.apache.org
>> Subject: Subscription Simulation
>>
>>  From the Getting Started guide,  So if a protocol doesn’t support
>> subscription based communication it is our goal to simulate this by polling
>> in the background so it is transparent for the users.
>>
>> Has this been implemented for any of the protocols?
>>
>> Thanks,
>> Andy
>>
> 

Re: Subscription Simulation

Posted by Andy Grebe <an...@gmail.com>.
hmmm...  I should probably push those CIP changes first :)

On Wed, May 25, 2022 at 10:14 AM Christofer Dutz <ch...@c-ware.de>
wrote:

> Hi Andy,
>
> It still is our plan :-)
>
> Just nobody did it yet ;-)
>
> Chris
>
> -----Original Message-----
> From: Andy Grebe <an...@gmail.com>
> Sent: Mittwoch, 25. Mai 2022 15:58
> To: dev@plc4x.apache.org
> Subject: Subscription Simulation
>
> From the Getting Started guide,  So if a protocol doesn’t support
> subscription based communication it is our goal to simulate this by polling
> in the background so it is transparent for the users.
>
> Has this been implemented for any of the protocols?
>
> Thanks,
> Andy
>

RE: Subscription Simulation

Posted by Christofer Dutz <ch...@c-ware.de>.
Hi Andy,

It still is our plan :-)

Just nobody did it yet ;-)

Chris

-----Original Message-----
From: Andy Grebe <an...@gmail.com> 
Sent: Mittwoch, 25. Mai 2022 15:58
To: dev@plc4x.apache.org
Subject: Subscription Simulation

From the Getting Started guide,  So if a protocol doesn’t support subscription based communication it is our goal to simulate this by polling in the background so it is transparent for the users.

Has this been implemented for any of the protocols?

Thanks,
Andy