cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
699
Views
1
Helpful
2
Replies

Using the Context Service SDK in an Application Server

joshorva
Cisco Employee
Cisco Employee

I am developing a Web Application that will make use of Context Service. An interesting issue occurs during shutdown of the Context Service client-side environment. When my Web Application is finished using Context Service, it calls the "destroy" method on the Management Connector and it calls the "destroyAndDeleteConnector" method on the Context Service Client. When the application server (in this case I am using Tomcat) is told to shutdown the Web Application, or when the Web Application is reloaded, then the Application Server does not seem to be able to shutdown the Web Application successfully. It seems to act like there is at least one running thread left over, causing the application server to wait until all threads for that Web Application stop running.

A standalone Java Application that uses the Context Service SDK seems to exhibit a similar type of behavior. If the "main" Java Application simply calls the methods in the previous paragraph and returns, then the Java Application does not stop running. One needs to specifically call "System.exit()" in order to get the Java Application to terminate.

When using the Context Service client side SDK in an Application Server, if there a method I can call to ensure that all background threads are stopped specifically for Context Service?

1 Accepted Solution

Accepted Solutions

ccosenti
Level 1
Level 1

Hi Joseph,

It looks like you've found an issue. The destroyAndDeleteConnector method is not killing all of its open connections. It looks like it is leaving a connection refresh open. If you left left a terminal open then you'd see the Context Service client start sending messages several minutes after you destory the connection. Then sleep for 15 minutes and send messages again until killed.

We've opened an issue on this. Thanks!

-Chris

View solution in original post

2 Replies 2

ccosenti
Level 1
Level 1

Hi Joseph,

It looks like you've found an issue. The destroyAndDeleteConnector method is not killing all of its open connections. It looks like it is leaving a connection refresh open. If you left left a terminal open then you'd see the Context Service client start sending messages several minutes after you destory the connection. Then sleep for 15 minutes and send messages again until killed.

We've opened an issue on this. Thanks!

-Chris

Make sure you always have latest version of the Static SDK, currently at 1.0.7. Dynamic SDK Extension will get upgraded automatically. Some registration related issues were fixed in the last 1 month (April-May 2016).

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: