Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

Close
Important Announcement: WELCOME to the new Schneider Electric Community! Community is now no longer part of Exchange, and is now rebranded under se.com. If you have any bookmarks and links saved, we request you to update them to ensure that you continue accessing our community from this new location. For any issues that you might encounter as part of this change, please reach out to SchneiderCommunity.Support@se.com, and the team will help to get your issues resolved.
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
82523members
350129posts

EWS Server - Notifications

SmartConnector Forum

Discussion of SmartConnector applications for integration of various other building management systems (BMS) into EcoStruxure Building Operation

Solved
mike_meirovitz
Commander
Commander

EWS Server - Notifications

Hi,

We have a customer who is using our EBO-OPC Client (EWS Server). In SmartConnector, under EWS Server, there is a branch called "Notifications" with 25,770 items. See below.

Capture_Jerzy.JPG

Can you please explain what is the meaning of this branch and why there are so many items in it? 

On our server we don't see this branch.

 

Thank you.

 

Mike

 

Tags (1)

Accepted Solutions
JeffBowman
Schneider Alumni (Retired)
Schneider Alumni (Retired)

Re: EWS Server - Notifications

Hi Michael,

 

These are there due to Subscriptions from EBO asking for updated values.

 

However! These should be being cleaned up by your Update Processor every run so they don't eventually cause the database to become slow.

 

If you are using the EwsItemManager in the SmartConnector.Utilities library you can call:

 

EwsItemManager.DeleteSubscriptionNotifications();

 

If you are using the DataAdapter directly, you would need to implement it yourself. I have pasted the code from SmartConnector utilities incase you need it.

var dataAdapter = DataAdapter;
try
{
Logger.LogTrace("EwsItemManager", $"DeleteSubscriptionNotifications");
dataAdapter.AutoCommit = false;
if (subscriptions == null)
{
subscriptions = dataAdapter.Subscriptions.ToList();
}

var ewsSubscriptions = subscriptions as IList<EwsSubscription> ?? subscriptions.ToList();
foreach (var subscription in ewsSubscriptions)
{
dataAdapter.DeleteNotifications(subscription);
}

if (ewsSubscriptions.Count > 0)
{
dataAdapter.DeleteSubscription(ewsSubscriptions
.Where(a => a.Status != EwsSubscriptionStatusEnum.Active).ToList());
}

dataAdapter.CommitChanges();
dataAdapter.AutoCommit = true;
}
catch (SqlException ex)
{

// It is possible that there is already too many entries in the tables to delete without timing out. In that case, you need to log into SQL Management Studio and Truncate the EwsNotificationItems, and EwsSubscriptionItems tables manually.

}

 

Best Regards,

 

-Jeff

See Answer In Context

Tags (1)
mike_meirovitz
Commander
Commander
0 Likes
4
468

Hi JeffRe: EWS Server - Notifications

Hi Jeff,

 

Thank you for your answer. Few questions:

 

1. Can these notifications be avoided/disabled? I had a demo today with a potential customer from Poland. The customer was concerned that with a large number of OPC items (20,000 to 30,000) these notifications will consume space, memory and may slow down the EWS server and the EBO.

 

2. You wrote "These notifications should be cleaned up by your Update Processor every run". Note that our update processor's Runs On Schedule is False . How often we should do the cleanup? Will this affect the performance?

 

3. Why I see these notification events on the customer's SmartConnector EWS and not on my SmartConnector EWS?

 

Thank you.

 

Mike

See Answer In Context

Tags (1)
6 Replies 6
JeffBowman
Schneider Alumni (Retired)
Schneider Alumni (Retired)

Re: EWS Server - Notifications

Hi Michael,

 

These are there due to Subscriptions from EBO asking for updated values.

 

However! These should be being cleaned up by your Update Processor every run so they don't eventually cause the database to become slow.

 

If you are using the EwsItemManager in the SmartConnector.Utilities library you can call:

 

EwsItemManager.DeleteSubscriptionNotifications();

 

If you are using the DataAdapter directly, you would need to implement it yourself. I have pasted the code from SmartConnector utilities incase you need it.

var dataAdapter = DataAdapter;
try
{
Logger.LogTrace("EwsItemManager", $"DeleteSubscriptionNotifications");
dataAdapter.AutoCommit = false;
if (subscriptions == null)
{
subscriptions = dataAdapter.Subscriptions.ToList();
}

var ewsSubscriptions = subscriptions as IList<EwsSubscription> ?? subscriptions.ToList();
foreach (var subscription in ewsSubscriptions)
{
dataAdapter.DeleteNotifications(subscription);
}

if (ewsSubscriptions.Count > 0)
{
dataAdapter.DeleteSubscription(ewsSubscriptions
.Where(a => a.Status != EwsSubscriptionStatusEnum.Active).ToList());
}

dataAdapter.CommitChanges();
dataAdapter.AutoCommit = true;
}
catch (SqlException ex)
{

// It is possible that there is already too many entries in the tables to delete without timing out. In that case, you need to log into SQL Management Studio and Truncate the EwsNotificationItems, and EwsSubscriptionItems tables manually.

}

 

Best Regards,

 

-Jeff

Tags (1)
mike_meirovitz
Commander
Commander
0 Likes
4
469

Hi JeffRe: EWS Server - Notifications

Hi Jeff,

 

Thank you for your answer. Few questions:

 

1. Can these notifications be avoided/disabled? I had a demo today with a potential customer from Poland. The customer was concerned that with a large number of OPC items (20,000 to 30,000) these notifications will consume space, memory and may slow down the EWS server and the EBO.

 

2. You wrote "These notifications should be cleaned up by your Update Processor every run". Note that our update processor's Runs On Schedule is False . How often we should do the cleanup? Will this affect the performance?

 

3. Why I see these notification events on the customer's SmartConnector EWS and not on my SmartConnector EWS?

 

Thank you.

 

Mike

Tags (1)
JeffBowman
Schneider Alumni (Retired)
Schneider Alumni (Retired)
0 Likes
3
466

Re: Hi JeffRe: EWS Server - Notifications

Hi Michael,

 

1. No, these are required for EWS Value Updates. If EBO is connected to your EWS server, these will be created.

2. If it is not runs on a schedule, then I assume your processor has some sort of loop to keep making sure the values are up to date. You should hook it into there somewhere. The alternative approach, is that with the Smart Connector.Utilities library, there is a utility processor that you can configure to run on a loop that will clean these up in your EWS Server for you, so you don't need to modify your code.

3. Do you have EBO pointing at your EWS server?

 

Best Regards,

 

-Jeff

Tags (1)
mike_meirovitz
Commander
Commander
0 Likes
2
465

Re: EWS Server - Notifications

Hi Jeff,

 

Thank you for your answers. 

 

3. Yes. Now I see it. So if I have 20,000 points/values, should I see 20,000 notification items in the EWS?

 

What is the value of showing this information in the EWS tab in SmartConnector web interface? I mean, if it will be cleaned by the processor in a loop. 

 

Thanks.

 

Mike 

Tags (1)
JeffBowman
Schneider Alumni (Retired)
Schneider Alumni (Retired)
0 Likes
0
460

Re: EWS Server - Notifications

Hi Michael,

 

If you are subscribing to 20,000 points in your EWS server, from EBO then I would expect that you would have 20,000, and if you clean up the notifications as you should, you shouldn't really ever go over this number. 

 

As long as you are not building up Notification items in your database, you will be fine with 20,000.

 

As far as to why we show this information in the EWS Server. An EWS Server does not NEED to be attached to a processor, the web interface is for the Smart Connector EWS Server as a whole, not related to a specific extension.

 

Best Regards,

 

-Jeff

Tags (1)
SteveGregory
Commander Commander
Commander
0 Likes
0
362

Re: EWS Server - Notifications

Hi Michael, did you end up implementing the EwsItemManager.DeleteSubscriptionNotifications() functions in your OPC SmartConnector? We are using it on one of our projects and we are getting the issue described here.

Steve

Tags (1)