Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[milo-dev] Reply: How to cache message in milo client?

Herron,

Thanks for your help! Sorry for the late reply, because of a vacation.
I understand your method: Adjust the publishing interval to match consume speed.

------------------------------------------------------------------
发件人:Kevin Herron <kevinherron@xxxxxxxxx>
发送时间:2017年10月1日(星期日) 06:12
收件人:george.ray <george.ray@xxxxxxxxxx>
抄 送:milo-dev <milo-dev@xxxxxxxxxxx>
主 题:Re: Reply: How to cache message in milo client?

George,

I think I misunderstood your original question.

The behavior you're seeing is because notifications received by the client are delivered to your callbacks on queue, in order, as they are received. If you're unable to consume the messages fast enough that queue will start to fill. You can see the mechanics of this in OpcUaSubscriptionManager:deliverNotificationMessage().

You should be able to use the parameters for subscriptions and monitored items I mentioned in my first message to ensure the server does not poll its underlying datasources and delivers notifications faster than you can consume it.



On Fri, Sep 29, 2017 at 7:58 PM, george.ray <george.ray@xxxxxxxxxx> wrote:
Kevin,

I consult the cache problem because found a phenomenon in testing:
The device generates 400 messages per second, and the business layer consume 200 messages per second. In this case, after a period of time, then power off the device, but milo continues to call back the subscription data for a long time. If there is no cache for subscription data, I can not explain this phenomenon.

------------------------------------------------------------------
发件人:Kevin Herron <kevinherron@xxxxxxxxx>
发送时间:2017年9月28日(星期四) 05:38
收件人:george.ray <george.ray@xxxxxxxxxx>
抄 送:milo developer discussions <milo-dev@xxxxxxxxxxx>
主 题:Re: How to cache message in milo client?

George,

There's no caching in the client, but you have some options to control how much and how often the server reports data changes.

When creating the subscription, you choose the publishing interval, which is how often the client will receive data change notification. Each data change notification contains multiple values, batched up if necessary.

When creating a monitored item, you can choose the sampling interval and a queue size. This influences how often the server should sample the underlying data source and as well as the size of the queue that holds value changes in between the intervals that a subscription batches and reports at.

On Wed, Sep 27, 2017 at 12:58 AM, george.ray <george.ray@xxxxxxxxxx> wrote:
Hi all,

I subscribe device message with milo client sdk in my appliction. 
There is a question:
If device generate 400 messages in a second, but business layer can consume 200 messages in a second, how to cache message in milo client?
And after a period of time, is there a huge backlog of messages? If I want to handle the latest message always, is there any cache policy in milo client? 

Thanks!

Best regards, 
George Ray





Back to the top