You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by Unai Leria <un...@zylk.net.INVALID> on 2023/02/21 13:16:51 UTC

Issue with CachedPlcConnectionManager in nifi integration

Hi, 

I've been working with the CachedPlcConnectionManager on the NiFi integration and I have encountered a problem while looking at issue [ https://github.com/apache/plc4x/issues/623 | #623 ] : 
When a successful connection is already stored in the cache and the network connection breaks the connections in the cache are no longer usable, but I have not been able to remove them. 
This makes the processor not work until it is manually disabled and enabled. 

For the NiFi integration to work properly there should be a way of removing a connection from the cache if it is invalid. 

I would appreciate some guidance. 

Unai 

Re: Issue with CachedPlcConnectionManager in nifi integration

Posted by Unai Leria <un...@zylk.net.INVALID>.
The only change I did in the nifi integration is to add a timeout in the the CompletableFutures of write/read requests.
Not sure what the maxUseTime changes do.

Unai

----- Mensaje original -----
De: "Christofer Dutz" <ch...@c-ware.de>
Para: "dev" <de...@plc4x.apache.org>
Enviados: Miércoles, 22 de Febrero 2023 11:40:23
Asunto: Re: Issue with CachedPlcConnectionManager in nifi integration

Could you please summarize which changes these were exactly? Removing the maxUserTime? Because if this is the case, we probably need to have a look at how you are using the ConnectionCache.

Chris

Re: Issue with CachedPlcConnectionManager in nifi integration

Posted by Łukasz Dywicki <lu...@code-house.org>.
I think for that case we have connection state listener which might be 
help with such cases.

Best,
Łukasz

On 22.02.2023 11:58, youlin he wrote:
> I have restored maxUserTime.
> 
> Sometimes we must hold the connection for a long time. For example, in the
> loop retrieve PLC data.
> 
> If request timeout the base drive will throw a timeoutException and
> cacheManage will close this real connection and set the isConnected of the
> leased connection as false.
> So we can determine whether the connection is closed in the loop and
> automatically connect if it is closed.
> 
> If you can merge my New PR. We should remove maxUserTime again.
> 
> Christofer Dutz <ch...@c-ware.de> 于2023年2月22日周三 18:40写道:
> 
>> Could you please summarize which changes these were exactly? Removing the
>> maxUserTime? Because if this is the case, we probably need to have a look
>> at how you are using the ConnectionCache.
>>
>> Chris
>>
>>
>> From: Unai Leria <un...@zylk.net.INVALID>
>> Date: Wednesday, 22. February 2023 at 10:34
>> To: dev <de...@plc4x.apache.org>
>> Subject: Re: Issue with CachedPlcConnectionManager in nifi integration
>> For the nifi integration to work I did only use the changes on
>> plc4x/plc4j/tools/connection-cache from spnettec/plc4x/tree/heyoulin.
>> Plus some minor changes in the nifi integration to add a timeout to all
>> processors.
>>
>> Unai
>>
>> ----- Mensaje original -----
>> De: "youlin he" <he...@gmail.com>
>> Para: "dev" <de...@plc4x.apache.org>, "Christofer Dutz" <
>> christofer.dutz@c-ware.de>
>> Enviados: Miércoles, 22 de Febrero 2023 10:21:51
>> Asunto: Re: Issue with CachedPlcConnectionManager in nifi integration
>>
>> But it should be based on driver base revision. Otherwise network
>> connection breaks would still happen.
>> @Christofer Dutz <ch...@c-ware.de>
>>
>> youlin he <he...@gmail.com> 于2023年2月22日周三 17:16写道:
>>
>>> Ok. I will create a PR
>>>
>>> Christofer Dutz <ch...@c-ware.de> 于2023年2月22日周三 16:44写道:
>>>
>>>> Unfortunately, this is not a branch, but a fork … Would you be able to
>>>> pull the changes that made it work in a separate PR? Then we can more
>>>> quickly adopt the changes, because we definitely are not going to merge
>>>> that PR (At least I’m not going to do it)
>>>>
>>>> Chris
>>>>
>>>>
>>>> From: Unai Leria <un...@zylk.net.INVALID>
>>>> Date: Wednesday, 22. February 2023 at 09:28
>>>> To: dev <de...@plc4x.apache.org>
>>>> Subject: Re: Issue with CachedPlcConnectionManager in nifi integration
>>>> It does work in the heyoulin branch. Thanks you.
>>>>
>>>> Unai
>>>>
>>>> ----- Mensaje original -----
>>>> De: "youlin he" <he...@gmail.com>
>>>> Para: "dev" <de...@plc4x.apache.org>
>>>> Enviados: Martes, 21 de Febrero 2023 14:54:14
>>>> Asunto: Re: Issue with CachedPlcConnectionManager in nifi integration
>>>>
>>>> I removed the maxUseTime. I think it is unnecessary to add
>> request-timeout
>>>> feature in the next version.
>>>>
>>>> youlin he <he...@gmail.com> 于2023年2月21日周二 21:48写道:
>>>>
>>>>> Can you test use https://github.com/spnettec/plc4x  heyoulin branch.
>> I
>>>>> fixed this problem.
>>>>>
>>>>> Unai Leria <un...@zylk.net.invalid> 于2023年2月21日周二 21:17写道:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I've been working with the CachedPlcConnectionManager on the NiFi
>>>>>> integration and I have encountered a problem while looking at issue [
>>>>>> https://github.com/apache/plc4x/issues/623 | #623 ] :
>>>>>> When a successful connection is already stored in the cache and the
>>>>>> network connection breaks the connections in the cache are no longer
>>>>>> usable, but I have not been able to remove them.
>>>>>> This makes the processor not work until it is manually disabled and
>>>>>> enabled.
>>>>>>
>>>>>> For the NiFi integration to work properly there should be a way of
>>>>>> removing a connection from the cache if it is invalid.
>>>>>>
>>>>>> I would appreciate some guidance.
>>>>>>
>>>>>> Unai
>>>>>>
>>>>>
>>>>
>>>
>>
> 

Re: Issue with CachedPlcConnectionManager in nifi integration

Posted by youlin he <he...@gmail.com>.
@Override
public PlcReadRequest.Builder readRequestBuilder() {
    if(connection == null) {
        throw new PlcRuntimeException("Error using leased connection
after returning it to the cache.");
    }
    final PlcReadRequest.Builder innerBuilder = connection.readRequestBuilder();
    return new PlcReadRequest.Builder(){

        @Override
        public PlcReadRequest build() {
            final PlcReadRequest innerPlcReadRequest = innerBuilder.build();
            return new PlcReadRequest(){

                @Override
                public CompletableFuture<? extends PlcReadResponse> execute() {
                    CompletableFuture<? extends PlcReadResponse>
future = innerPlcReadRequest.execute();
                    final CompletableFuture<PlcReadResponse>
responseFuture = new CompletableFuture<>();
                    future.handle((plcReadResponse, throwable) -> {
                        if (plcReadResponse != null) {
                            responseFuture.complete(plcReadResponse);
                        } else {

                                 *// Sometime request have some
problem maybe the connection died. *

*                    We must close the real connection.*
                            try {
                                destroy();

                                 *// In here auto re-connect?  I mean
lease a connection*
                            } catch (Exception e) {
                            }
                            responseFuture.completeExceptionally(throwable);
                        }
                        return null;
                    });
                    return responseFuture;
                }

                @Override
                public int getNumberOfTags() {
                    return innerPlcReadRequest.getNumberOfTags();
                }

                @Override
                public LinkedHashSet<String> getTagNames() {
                    return innerPlcReadRequest.getTagNames();
                }

                @Override
                public PlcTag getTag(String name) {
                    return innerPlcReadRequest.getTag(name);
                }

                @Override
                public List<PlcTag> getTags() {
                    return innerPlcReadRequest.getTags();
                }
            };
        }

        @Override
        public PlcReadRequest.Builder addTagAddress(String name,
String tagAddress) {
            return innerBuilder.addTagAddress(name, tagAddress);
        }

        @Override
        public PlcReadRequest.Builder addTag(String name, PlcTag tag) {
            return innerBuilder.addTag(name,tag);
        }
    };
}


youlin he <he...@gmail.com> 于2023年2月22日周三 18:58写道:

> I have restored maxUserTime.
>
> Sometimes we must hold the connection for a long time. For example, in the
> loop retrieve PLC data.
>
> If request timeout the base drive will throw a timeoutException and
> cacheManage will close this real connection and set the isConnected of the
> leased connection as false.
> So we can determine whether the connection is closed in the loop and
> automatically connect if it is closed.
>
> If you can merge my New PR. We should remove maxUserTime again.
>
> Christofer Dutz <ch...@c-ware.de> 于2023年2月22日周三 18:40写道:
>
>> Could you please summarize which changes these were exactly? Removing the
>> maxUserTime? Because if this is the case, we probably need to have a look
>> at how you are using the ConnectionCache.
>>
>> Chris
>>
>>
>> From: Unai Leria <un...@zylk.net.INVALID>
>> Date: Wednesday, 22. February 2023 at 10:34
>> To: dev <de...@plc4x.apache.org>
>> Subject: Re: Issue with CachedPlcConnectionManager in nifi integration
>> For the nifi integration to work I did only use the changes on
>> plc4x/plc4j/tools/connection-cache from spnettec/plc4x/tree/heyoulin.
>> Plus some minor changes in the nifi integration to add a timeout to all
>> processors.
>>
>> Unai
>>
>> ----- Mensaje original -----
>> De: "youlin he" <he...@gmail.com>
>> Para: "dev" <de...@plc4x.apache.org>, "Christofer Dutz" <
>> christofer.dutz@c-ware.de>
>> Enviados: Miércoles, 22 de Febrero 2023 10:21:51
>> Asunto: Re: Issue with CachedPlcConnectionManager in nifi integration
>>
>> But it should be based on driver base revision. Otherwise network
>> connection breaks would still happen.
>> @Christofer Dutz <ch...@c-ware.de>
>>
>> youlin he <he...@gmail.com> 于2023年2月22日周三 17:16写道:
>>
>> > Ok. I will create a PR
>> >
>> > Christofer Dutz <ch...@c-ware.de> 于2023年2月22日周三 16:44写道:
>> >
>> >> Unfortunately, this is not a branch, but a fork … Would you be able to
>> >> pull the changes that made it work in a separate PR? Then we can more
>> >> quickly adopt the changes, because we definitely are not going to merge
>> >> that PR (At least I’m not going to do it)
>> >>
>> >> Chris
>> >>
>> >>
>> >> From: Unai Leria <un...@zylk.net.INVALID>
>> >> Date: Wednesday, 22. February 2023 at 09:28
>> >> To: dev <de...@plc4x.apache.org>
>> >> Subject: Re: Issue with CachedPlcConnectionManager in nifi integration
>> >> It does work in the heyoulin branch. Thanks you.
>> >>
>> >> Unai
>> >>
>> >> ----- Mensaje original -----
>> >> De: "youlin he" <he...@gmail.com>
>> >> Para: "dev" <de...@plc4x.apache.org>
>> >> Enviados: Martes, 21 de Febrero 2023 14:54:14
>> >> Asunto: Re: Issue with CachedPlcConnectionManager in nifi integration
>> >>
>> >> I removed the maxUseTime. I think it is unnecessary to add
>> request-timeout
>> >> feature in the next version.
>> >>
>> >> youlin he <he...@gmail.com> 于2023年2月21日周二 21:48写道:
>> >>
>> >> > Can you test use https://github.com/spnettec/plc4x  heyoulin
>> branch. I
>> >> > fixed this problem.
>> >> >
>> >> > Unai Leria <un...@zylk.net.invalid> 于2023年2月21日周二 21:17写道:
>> >> >
>> >> >> Hi,
>> >> >>
>> >> >> I've been working with the CachedPlcConnectionManager on the NiFi
>> >> >> integration and I have encountered a problem while looking at issue
>> [
>> >> >> https://github.com/apache/plc4x/issues/623 | #623 ] :
>> >> >> When a successful connection is already stored in the cache and the
>> >> >> network connection breaks the connections in the cache are no longer
>> >> >> usable, but I have not been able to remove them.
>> >> >> This makes the processor not work until it is manually disabled and
>> >> >> enabled.
>> >> >>
>> >> >> For the NiFi integration to work properly there should be a way of
>> >> >> removing a connection from the cache if it is invalid.
>> >> >>
>> >> >> I would appreciate some guidance.
>> >> >>
>> >> >> Unai
>> >> >>
>> >> >
>> >>
>> >
>>
>

Re: Issue with CachedPlcConnectionManager in nifi integration

Posted by youlin he <he...@gmail.com>.
I have restored maxUserTime.

Sometimes we must hold the connection for a long time. For example, in the
loop retrieve PLC data.

If request timeout the base drive will throw a timeoutException and
cacheManage will close this real connection and set the isConnected of the
leased connection as false.
So we can determine whether the connection is closed in the loop and
automatically connect if it is closed.

If you can merge my New PR. We should remove maxUserTime again.

Christofer Dutz <ch...@c-ware.de> 于2023年2月22日周三 18:40写道:

> Could you please summarize which changes these were exactly? Removing the
> maxUserTime? Because if this is the case, we probably need to have a look
> at how you are using the ConnectionCache.
>
> Chris
>
>
> From: Unai Leria <un...@zylk.net.INVALID>
> Date: Wednesday, 22. February 2023 at 10:34
> To: dev <de...@plc4x.apache.org>
> Subject: Re: Issue with CachedPlcConnectionManager in nifi integration
> For the nifi integration to work I did only use the changes on
> plc4x/plc4j/tools/connection-cache from spnettec/plc4x/tree/heyoulin.
> Plus some minor changes in the nifi integration to add a timeout to all
> processors.
>
> Unai
>
> ----- Mensaje original -----
> De: "youlin he" <he...@gmail.com>
> Para: "dev" <de...@plc4x.apache.org>, "Christofer Dutz" <
> christofer.dutz@c-ware.de>
> Enviados: Miércoles, 22 de Febrero 2023 10:21:51
> Asunto: Re: Issue with CachedPlcConnectionManager in nifi integration
>
> But it should be based on driver base revision. Otherwise network
> connection breaks would still happen.
> @Christofer Dutz <ch...@c-ware.de>
>
> youlin he <he...@gmail.com> 于2023年2月22日周三 17:16写道:
>
> > Ok. I will create a PR
> >
> > Christofer Dutz <ch...@c-ware.de> 于2023年2月22日周三 16:44写道:
> >
> >> Unfortunately, this is not a branch, but a fork … Would you be able to
> >> pull the changes that made it work in a separate PR? Then we can more
> >> quickly adopt the changes, because we definitely are not going to merge
> >> that PR (At least I’m not going to do it)
> >>
> >> Chris
> >>
> >>
> >> From: Unai Leria <un...@zylk.net.INVALID>
> >> Date: Wednesday, 22. February 2023 at 09:28
> >> To: dev <de...@plc4x.apache.org>
> >> Subject: Re: Issue with CachedPlcConnectionManager in nifi integration
> >> It does work in the heyoulin branch. Thanks you.
> >>
> >> Unai
> >>
> >> ----- Mensaje original -----
> >> De: "youlin he" <he...@gmail.com>
> >> Para: "dev" <de...@plc4x.apache.org>
> >> Enviados: Martes, 21 de Febrero 2023 14:54:14
> >> Asunto: Re: Issue with CachedPlcConnectionManager in nifi integration
> >>
> >> I removed the maxUseTime. I think it is unnecessary to add
> request-timeout
> >> feature in the next version.
> >>
> >> youlin he <he...@gmail.com> 于2023年2月21日周二 21:48写道:
> >>
> >> > Can you test use https://github.com/spnettec/plc4x  heyoulin branch.
> I
> >> > fixed this problem.
> >> >
> >> > Unai Leria <un...@zylk.net.invalid> 于2023年2月21日周二 21:17写道:
> >> >
> >> >> Hi,
> >> >>
> >> >> I've been working with the CachedPlcConnectionManager on the NiFi
> >> >> integration and I have encountered a problem while looking at issue [
> >> >> https://github.com/apache/plc4x/issues/623 | #623 ] :
> >> >> When a successful connection is already stored in the cache and the
> >> >> network connection breaks the connections in the cache are no longer
> >> >> usable, but I have not been able to remove them.
> >> >> This makes the processor not work until it is manually disabled and
> >> >> enabled.
> >> >>
> >> >> For the NiFi integration to work properly there should be a way of
> >> >> removing a connection from the cache if it is invalid.
> >> >>
> >> >> I would appreciate some guidance.
> >> >>
> >> >> Unai
> >> >>
> >> >
> >>
> >
>

Re: Issue with CachedPlcConnectionManager in nifi integration

Posted by Christofer Dutz <ch...@c-ware.de>.
Could you please summarize which changes these were exactly? Removing the maxUserTime? Because if this is the case, we probably need to have a look at how you are using the ConnectionCache.

Chris


From: Unai Leria <un...@zylk.net.INVALID>
Date: Wednesday, 22. February 2023 at 10:34
To: dev <de...@plc4x.apache.org>
Subject: Re: Issue with CachedPlcConnectionManager in nifi integration
For the nifi integration to work I did only use the changes on plc4x/plc4j/tools/connection-cache from spnettec/plc4x/tree/heyoulin.
Plus some minor changes in the nifi integration to add a timeout to all processors.

Unai

----- Mensaje original -----
De: "youlin he" <he...@gmail.com>
Para: "dev" <de...@plc4x.apache.org>, "Christofer Dutz" <ch...@c-ware.de>
Enviados: Miércoles, 22 de Febrero 2023 10:21:51
Asunto: Re: Issue with CachedPlcConnectionManager in nifi integration

But it should be based on driver base revision. Otherwise network
connection breaks would still happen.
@Christofer Dutz <ch...@c-ware.de>

youlin he <he...@gmail.com> 于2023年2月22日周三 17:16写道:

> Ok. I will create a PR
>
> Christofer Dutz <ch...@c-ware.de> 于2023年2月22日周三 16:44写道:
>
>> Unfortunately, this is not a branch, but a fork … Would you be able to
>> pull the changes that made it work in a separate PR? Then we can more
>> quickly adopt the changes, because we definitely are not going to merge
>> that PR (At least I’m not going to do it)
>>
>> Chris
>>
>>
>> From: Unai Leria <un...@zylk.net.INVALID>
>> Date: Wednesday, 22. February 2023 at 09:28
>> To: dev <de...@plc4x.apache.org>
>> Subject: Re: Issue with CachedPlcConnectionManager in nifi integration
>> It does work in the heyoulin branch. Thanks you.
>>
>> Unai
>>
>> ----- Mensaje original -----
>> De: "youlin he" <he...@gmail.com>
>> Para: "dev" <de...@plc4x.apache.org>
>> Enviados: Martes, 21 de Febrero 2023 14:54:14
>> Asunto: Re: Issue with CachedPlcConnectionManager in nifi integration
>>
>> I removed the maxUseTime. I think it is unnecessary to add request-timeout
>> feature in the next version.
>>
>> youlin he <he...@gmail.com> 于2023年2月21日周二 21:48写道:
>>
>> > Can you test use https://github.com/spnettec/plc4x  heyoulin branch. I
>> > fixed this problem.
>> >
>> > Unai Leria <un...@zylk.net.invalid> 于2023年2月21日周二 21:17写道:
>> >
>> >> Hi,
>> >>
>> >> I've been working with the CachedPlcConnectionManager on the NiFi
>> >> integration and I have encountered a problem while looking at issue [
>> >> https://github.com/apache/plc4x/issues/623 | #623 ] :
>> >> When a successful connection is already stored in the cache and the
>> >> network connection breaks the connections in the cache are no longer
>> >> usable, but I have not been able to remove them.
>> >> This makes the processor not work until it is manually disabled and
>> >> enabled.
>> >>
>> >> For the NiFi integration to work properly there should be a way of
>> >> removing a connection from the cache if it is invalid.
>> >>
>> >> I would appreciate some guidance.
>> >>
>> >> Unai
>> >>
>> >
>>
>

Re: Issue with CachedPlcConnectionManager in nifi integration

Posted by Unai Leria <un...@zylk.net.INVALID>.
For the nifi integration to work I did only use the changes on plc4x/plc4j/tools/connection-cache from spnettec/plc4x/tree/heyoulin.
Plus some minor changes in the nifi integration to add a timeout to all processors.

Unai

----- Mensaje original -----
De: "youlin he" <he...@gmail.com>
Para: "dev" <de...@plc4x.apache.org>, "Christofer Dutz" <ch...@c-ware.de>
Enviados: Miércoles, 22 de Febrero 2023 10:21:51
Asunto: Re: Issue with CachedPlcConnectionManager in nifi integration

But it should be based on driver base revision. Otherwise network
connection breaks would still happen.
@Christofer Dutz <ch...@c-ware.de>

youlin he <he...@gmail.com> 于2023年2月22日周三 17:16写道:

> Ok. I will create a PR
>
> Christofer Dutz <ch...@c-ware.de> 于2023年2月22日周三 16:44写道:
>
>> Unfortunately, this is not a branch, but a fork … Would you be able to
>> pull the changes that made it work in a separate PR? Then we can more
>> quickly adopt the changes, because we definitely are not going to merge
>> that PR (At least I’m not going to do it)
>>
>> Chris
>>
>>
>> From: Unai Leria <un...@zylk.net.INVALID>
>> Date: Wednesday, 22. February 2023 at 09:28
>> To: dev <de...@plc4x.apache.org>
>> Subject: Re: Issue with CachedPlcConnectionManager in nifi integration
>> It does work in the heyoulin branch. Thanks you.
>>
>> Unai
>>
>> ----- Mensaje original -----
>> De: "youlin he" <he...@gmail.com>
>> Para: "dev" <de...@plc4x.apache.org>
>> Enviados: Martes, 21 de Febrero 2023 14:54:14
>> Asunto: Re: Issue with CachedPlcConnectionManager in nifi integration
>>
>> I removed the maxUseTime. I think it is unnecessary to add request-timeout
>> feature in the next version.
>>
>> youlin he <he...@gmail.com> 于2023年2月21日周二 21:48写道:
>>
>> > Can you test use https://github.com/spnettec/plc4x  heyoulin branch. I
>> > fixed this problem.
>> >
>> > Unai Leria <un...@zylk.net.invalid> 于2023年2月21日周二 21:17写道:
>> >
>> >> Hi,
>> >>
>> >> I've been working with the CachedPlcConnectionManager on the NiFi
>> >> integration and I have encountered a problem while looking at issue [
>> >> https://github.com/apache/plc4x/issues/623 | #623 ] :
>> >> When a successful connection is already stored in the cache and the
>> >> network connection breaks the connections in the cache are no longer
>> >> usable, but I have not been able to remove them.
>> >> This makes the processor not work until it is manually disabled and
>> >> enabled.
>> >>
>> >> For the NiFi integration to work properly there should be a way of
>> >> removing a connection from the cache if it is invalid.
>> >>
>> >> I would appreciate some guidance.
>> >>
>> >> Unai
>> >>
>> >
>>
>

Re: Issue with CachedPlcConnectionManager in nifi integration

Posted by youlin he <he...@gmail.com>.
But it should be based on driver base revision. Otherwise network
connection breaks would still happen.
@Christofer Dutz <ch...@c-ware.de>

youlin he <he...@gmail.com> 于2023年2月22日周三 17:16写道:

> Ok. I will create a PR
>
> Christofer Dutz <ch...@c-ware.de> 于2023年2月22日周三 16:44写道:
>
>> Unfortunately, this is not a branch, but a fork … Would you be able to
>> pull the changes that made it work in a separate PR? Then we can more
>> quickly adopt the changes, because we definitely are not going to merge
>> that PR (At least I’m not going to do it)
>>
>> Chris
>>
>>
>> From: Unai Leria <un...@zylk.net.INVALID>
>> Date: Wednesday, 22. February 2023 at 09:28
>> To: dev <de...@plc4x.apache.org>
>> Subject: Re: Issue with CachedPlcConnectionManager in nifi integration
>> It does work in the heyoulin branch. Thanks you.
>>
>> Unai
>>
>> ----- Mensaje original -----
>> De: "youlin he" <he...@gmail.com>
>> Para: "dev" <de...@plc4x.apache.org>
>> Enviados: Martes, 21 de Febrero 2023 14:54:14
>> Asunto: Re: Issue with CachedPlcConnectionManager in nifi integration
>>
>> I removed the maxUseTime. I think it is unnecessary to add request-timeout
>> feature in the next version.
>>
>> youlin he <he...@gmail.com> 于2023年2月21日周二 21:48写道:
>>
>> > Can you test use https://github.com/spnettec/plc4x  heyoulin branch. I
>> > fixed this problem.
>> >
>> > Unai Leria <un...@zylk.net.invalid> 于2023年2月21日周二 21:17写道:
>> >
>> >> Hi,
>> >>
>> >> I've been working with the CachedPlcConnectionManager on the NiFi
>> >> integration and I have encountered a problem while looking at issue [
>> >> https://github.com/apache/plc4x/issues/623 | #623 ] :
>> >> When a successful connection is already stored in the cache and the
>> >> network connection breaks the connections in the cache are no longer
>> >> usable, but I have not been able to remove them.
>> >> This makes the processor not work until it is manually disabled and
>> >> enabled.
>> >>
>> >> For the NiFi integration to work properly there should be a way of
>> >> removing a connection from the cache if it is invalid.
>> >>
>> >> I would appreciate some guidance.
>> >>
>> >> Unai
>> >>
>> >
>>
>

Re: Issue with CachedPlcConnectionManager in nifi integration

Posted by youlin he <he...@gmail.com>.
Ok. I will create a PR

Christofer Dutz <ch...@c-ware.de> 于2023年2月22日周三 16:44写道:

> Unfortunately, this is not a branch, but a fork … Would you be able to
> pull the changes that made it work in a separate PR? Then we can more
> quickly adopt the changes, because we definitely are not going to merge
> that PR (At least I’m not going to do it)
>
> Chris
>
>
> From: Unai Leria <un...@zylk.net.INVALID>
> Date: Wednesday, 22. February 2023 at 09:28
> To: dev <de...@plc4x.apache.org>
> Subject: Re: Issue with CachedPlcConnectionManager in nifi integration
> It does work in the heyoulin branch. Thanks you.
>
> Unai
>
> ----- Mensaje original -----
> De: "youlin he" <he...@gmail.com>
> Para: "dev" <de...@plc4x.apache.org>
> Enviados: Martes, 21 de Febrero 2023 14:54:14
> Asunto: Re: Issue with CachedPlcConnectionManager in nifi integration
>
> I removed the maxUseTime. I think it is unnecessary to add request-timeout
> feature in the next version.
>
> youlin he <he...@gmail.com> 于2023年2月21日周二 21:48写道:
>
> > Can you test use https://github.com/spnettec/plc4x  heyoulin branch. I
> > fixed this problem.
> >
> > Unai Leria <un...@zylk.net.invalid> 于2023年2月21日周二 21:17写道:
> >
> >> Hi,
> >>
> >> I've been working with the CachedPlcConnectionManager on the NiFi
> >> integration and I have encountered a problem while looking at issue [
> >> https://github.com/apache/plc4x/issues/623 | #623 ] :
> >> When a successful connection is already stored in the cache and the
> >> network connection breaks the connections in the cache are no longer
> >> usable, but I have not been able to remove them.
> >> This makes the processor not work until it is manually disabled and
> >> enabled.
> >>
> >> For the NiFi integration to work properly there should be a way of
> >> removing a connection from the cache if it is invalid.
> >>
> >> I would appreciate some guidance.
> >>
> >> Unai
> >>
> >
>

Re: Issue with CachedPlcConnectionManager in nifi integration

Posted by Christofer Dutz <ch...@c-ware.de>.
Unfortunately, this is not a branch, but a fork … Would you be able to pull the changes that made it work in a separate PR? Then we can more quickly adopt the changes, because we definitely are not going to merge that PR (At least I’m not going to do it)

Chris


From: Unai Leria <un...@zylk.net.INVALID>
Date: Wednesday, 22. February 2023 at 09:28
To: dev <de...@plc4x.apache.org>
Subject: Re: Issue with CachedPlcConnectionManager in nifi integration
It does work in the heyoulin branch. Thanks you.

Unai

----- Mensaje original -----
De: "youlin he" <he...@gmail.com>
Para: "dev" <de...@plc4x.apache.org>
Enviados: Martes, 21 de Febrero 2023 14:54:14
Asunto: Re: Issue with CachedPlcConnectionManager in nifi integration

I removed the maxUseTime. I think it is unnecessary to add request-timeout
feature in the next version.

youlin he <he...@gmail.com> 于2023年2月21日周二 21:48写道:

> Can you test use https://github.com/spnettec/plc4x  heyoulin branch. I
> fixed this problem.
>
> Unai Leria <un...@zylk.net.invalid> 于2023年2月21日周二 21:17写道:
>
>> Hi,
>>
>> I've been working with the CachedPlcConnectionManager on the NiFi
>> integration and I have encountered a problem while looking at issue [
>> https://github.com/apache/plc4x/issues/623 | #623 ] :
>> When a successful connection is already stored in the cache and the
>> network connection breaks the connections in the cache are no longer
>> usable, but I have not been able to remove them.
>> This makes the processor not work until it is manually disabled and
>> enabled.
>>
>> For the NiFi integration to work properly there should be a way of
>> removing a connection from the cache if it is invalid.
>>
>> I would appreciate some guidance.
>>
>> Unai
>>
>

Re: Issue with CachedPlcConnectionManager in nifi integration

Posted by Unai Leria <un...@zylk.net.INVALID>.
It does work in the heyoulin branch. Thanks you.

Unai

----- Mensaje original -----
De: "youlin he" <he...@gmail.com>
Para: "dev" <de...@plc4x.apache.org>
Enviados: Martes, 21 de Febrero 2023 14:54:14
Asunto: Re: Issue with CachedPlcConnectionManager in nifi integration

I removed the maxUseTime. I think it is unnecessary to add request-timeout
feature in the next version.

youlin he <he...@gmail.com> 于2023年2月21日周二 21:48写道:

> Can you test use https://github.com/spnettec/plc4x  heyoulin branch. I
> fixed this problem.
>
> Unai Leria <un...@zylk.net.invalid> 于2023年2月21日周二 21:17写道:
>
>> Hi,
>>
>> I've been working with the CachedPlcConnectionManager on the NiFi
>> integration and I have encountered a problem while looking at issue [
>> https://github.com/apache/plc4x/issues/623 | #623 ] :
>> When a successful connection is already stored in the cache and the
>> network connection breaks the connections in the cache are no longer
>> usable, but I have not been able to remove them.
>> This makes the processor not work until it is manually disabled and
>> enabled.
>>
>> For the NiFi integration to work properly there should be a way of
>> removing a connection from the cache if it is invalid.
>>
>> I would appreciate some guidance.
>>
>> Unai
>>
>

Re: Issue with CachedPlcConnectionManager in nifi integration

Posted by youlin he <he...@gmail.com>.
I removed the maxUseTime. I think it is unnecessary to add request-timeout
feature in the next version.

youlin he <he...@gmail.com> 于2023年2月21日周二 21:48写道:

> Can you test use https://github.com/spnettec/plc4x  heyoulin branch. I
> fixed this problem.
>
> Unai Leria <un...@zylk.net.invalid> 于2023年2月21日周二 21:17写道:
>
>> Hi,
>>
>> I've been working with the CachedPlcConnectionManager on the NiFi
>> integration and I have encountered a problem while looking at issue [
>> https://github.com/apache/plc4x/issues/623 | #623 ] :
>> When a successful connection is already stored in the cache and the
>> network connection breaks the connections in the cache are no longer
>> usable, but I have not been able to remove them.
>> This makes the processor not work until it is manually disabled and
>> enabled.
>>
>> For the NiFi integration to work properly there should be a way of
>> removing a connection from the cache if it is invalid.
>>
>> I would appreciate some guidance.
>>
>> Unai
>>
>

Re: Issue with CachedPlcConnectionManager in nifi integration

Posted by youlin he <he...@gmail.com>.
Can you test use https://github.com/spnettec/plc4x  heyoulin branch. I
fixed this problem.

Unai Leria <un...@zylk.net.invalid> 于2023年2月21日周二 21:17写道:

> Hi,
>
> I've been working with the CachedPlcConnectionManager on the NiFi
> integration and I have encountered a problem while looking at issue [
> https://github.com/apache/plc4x/issues/623 | #623 ] :
> When a successful connection is already stored in the cache and the
> network connection breaks the connections in the cache are no longer
> usable, but I have not been able to remove them.
> This makes the processor not work until it is manually disabled and
> enabled.
>
> For the NiFi integration to work properly there should be a way of
> removing a connection from the cache if it is invalid.
>
> I would appreciate some guidance.
>
> Unai
>