Package com.highdeal.cnd.message
Class AsyncStatefulServiceClientCtrl
java.lang.Object
com.highdeal.cnd.message.AsyncStatefulServiceClientCtrl
- All Implemented Interfaces:
ClientOpEventListener
This class represents a
It is possible to enable the average latency controller. But the expected latency cannot be lower than the system's minimum. This can decrease the charging operation throughput.
client operation event listener able to supervise
the activity of the instances of the SAP CC Core Server system by limiting the number of operations in the server instances. It is possible to enable the average latency controller. But the expected latency cannot be lower than the system's minimum. This can decrease the charging operation throughput.
Performance Management
You can fine tune the behavior of your client application for processing real-time charging services. The following advanced options are available:
maxQueueSizeToWait: This is the maximum number of requests to be sent that theAsyncStatefulServiceClientwill hold at a given point of time. This is used to avoid potential overflow of the connected SAP CC system. Asking the AsyncStatefulServiceClient to send additional requests beyond this parameter value will cause the client to wait before sending the extra requests.queueSizeToNotify: This is the maximum number of requests theAsyncStatefulServiceClientis awaiting a response for before it can send more requests to the connected SAP CC system. This is used to avoid potential overflow of the connected SAP CC system. Technically, if the number of requests already sent and not having received a response yet is greater than queueSizeToNotify, then no more additional requests will be sent by AsyncStatefulServiceClient. When the number of requests without a response drops below queueSizeToNotify, then the pending requests in the sending queue are sent.- The value of
queueSizeToNotifymust be strictly less thanmaxQueueSizeToWait. It must be a non-null value.
- The value of
Recommendation
During the implementation project phase:
-
You set up the maximum queue size to wait (
maxQueueSizeToWait) with the value of the STATEFUL_SERVICE_QUEUE_SIZE system parameter defined in the dispatcher instances of the SAP CC system. The dispatcher instances are the public endpoints of the Message TCP technical interface- In case
multiple charging clientsare used, the sum of all the queue sizes for all the clients shall be equal to the value of the STATEFUL_SERVICE_QUEUE_SIZE system parameter defined in the dispatcher instances of the connected SAP CC system.
- In case
-
You set up the queue size to notify (
queueSizeToNotify) with around 90% of the valuemaxQueueSizeToWait.
Implementation in Your Client Application
Code Snippet
Here is an example of use:
AsyncStatefulServiceClient client = new AsyncStatefulServiceClient();
client.setClientOpEventListener(ClientOpEventTopic.DEFAULT, new AsyncStatefulServiceClientCtrl());
Notes on SAP CC Implementation
This fine-tuning depends on the fine-tuning of the connected SAP CC system. This system may be customized during the implementation project phase. Consider the values of the STATEFUL_SERVICE_QUEUE_SIZE system parameter. Consult the SAP CC System Parameter Reference for more information.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionThis is an equivalent of AsyncStatefulServiceClientCtrl(AsyncStatefulServiceClientCtrl.QUEUE_SIZE_TO_WAIT_DEFAULT_VALUE, AsyncStatefulServiceClientCtrl.MIN_QUEUE_SIZE_TO_NOTIFY_VALUE)AsyncStatefulServiceClientCtrl(int queueSizeToWait, int queueSizeToNotify) The queueSizeToWait is the maximum number of waiting requests to be executed by the servers. -
Method Summary
Modifier and TypeMethodDescriptionvoidonLookupException(ClientOpEventInformation clientOpInfo) Called if an exception is raised during the guiding lookup before giving a response to the client.voidonLookupResult(ClientOpEventInformation clientOpInfo) Called when the guiding lookup result is received.onLookupStart(ClientOpEventTopic topic) Called before the guiding lookup only if the the guiding lookup is the first action of the client operation.voidonOpException(ClientOpEventInformation clientOpInfo) Called if an exception is raised during the operation execution before giving a response to the client.voidonOpResult(ClientOpEventInformation clientOpInfo) Called when the operation result is received.onOpStart(ClientOpEventTopic topic) Called when an operation start only if the first operation is not a guiding lookup.voidonOpStartAnotherOperation(ClientOpEventInformation clientOpInfo) Called when a failed operation implies to call another operation.voidsetClientQueueListenerSize(int maxQueueSizeToWait, int minQueueSizeToWait, int queueSizeToNotify, long spotLatency) The queueSizeToWait is the maximum number of waiting requests to be executed by the servers; Additional requests make the client waiting.
-
Field Details
-
QUEUE_SIZE_TO_WAIT_DEFAULT_VALUE
public static final int QUEUE_SIZE_TO_WAIT_DEFAULT_VALUE- See Also:
-
QUEUE_SIZE_TO_NOTIFY_DEFAULT_VALUE
public static final int QUEUE_SIZE_TO_NOTIFY_DEFAULT_VALUE- See Also:
-
MIN_QUEUE_SIZE_TO_WAIT_VALUE
public static final int MIN_QUEUE_SIZE_TO_WAIT_VALUE- See Also:
-
MIN_QUEUE_SIZE_TO_NOTIFY_VALUE
public static final int MIN_QUEUE_SIZE_TO_NOTIFY_VALUE- See Also:
-
-
Constructor Details
-
AsyncStatefulServiceClientCtrl
public AsyncStatefulServiceClientCtrl()This is an equivalent of AsyncStatefulServiceClientCtrl(AsyncStatefulServiceClientCtrl.QUEUE_SIZE_TO_WAIT_DEFAULT_VALUE, AsyncStatefulServiceClientCtrl.MIN_QUEUE_SIZE_TO_NOTIFY_VALUE) -
AsyncStatefulServiceClientCtrl
public AsyncStatefulServiceClientCtrl(int queueSizeToWait, int queueSizeToNotify) The queueSizeToWait is the maximum number of waiting requests to be executed by the servers. Additional requests make the client waiting. When the number of waiting requests get lower or equal to queueSizeToNotify and at least one client waits, all the clients are woke up.- Parameters:
queueSizeToWait- The queueSizeToWait value, the minimal value is MIN_QUEUE_SIZE_TO_WAIT_VALUE.queueSizeToNotify- The queueSizeToNotify value, the minimal value is MIN_QUEUE_SIZE_TO_NOTIFY_VALUE and the maximal value is the value of queueListenerSizeToWait parameter minus one.
-
-
Method Details
-
setClientQueueListenerSize
public void setClientQueueListenerSize(int maxQueueSizeToWait, int minQueueSizeToWait, int queueSizeToNotify, long spotLatency) The queueSizeToWait is the maximum number of waiting requests to be executed by the servers; Additional requests make the client waiting. The minQueueSizeToWait, maxQueueSizeToWait is couple of minimal, maximum values used to adapt queueSizeToWait according to expected latency. When the number of waiting requests get lower or equal to queueSizeToNotify and at least one client waits, all the clients are woke up.- Parameters:
maxQueueSizeToWait- The maxQueueSizeToWait value, the minimal value is MIN_QUEUE_SIZE_TO_WAIT_VALUE.minQueueSizeToWait- The minQueueSizeToWait value, the minimal value is MIN_QUEUE_SIZE_TO_WAIT_VALUE.queueSizeToNotify- The queueListenerSizeToNotify value, the minimal value is MIN_QUEUE_SIZE_TO_NOTIFY_VALUE and the maximal value is the value of queueListenerSizeToWait parameter minus one.spotLatency- The expected average latency. The minimal value is 1 to enable the average latency controller.
-
onLookupResult
Description copied from interface:ClientOpEventListenerCalled when the guiding lookup result is received.- Specified by:
onLookupResultin interfaceClientOpEventListener- Parameters:
clientOpInfo- The ClientOpEventInformation that generated the event.
-
onLookupStart
Description copied from interface:ClientOpEventListenerCalled before the guiding lookup only if the the guiding lookup is the first action of the client operation.- Specified by:
onLookupStartin interfaceClientOpEventListener- Parameters:
topic- the ClientOpEventTopic of the event.
-
onOpStart
Description copied from interface:ClientOpEventListenerCalled when an operation start only if the first operation is not a guiding lookup.- Specified by:
onOpStartin interfaceClientOpEventListener- Parameters:
topic- the ClientOpEventTopic of the event.
-
onLookupException
Description copied from interface:ClientOpEventListenerCalled if an exception is raised during the guiding lookup before giving a response to the client.- Specified by:
onLookupExceptionin interfaceClientOpEventListener- Parameters:
clientOpInfo- The ClientOpEventInformation that generated the event.
-
onOpResult
Description copied from interface:ClientOpEventListenerCalled when the operation result is received.- Specified by:
onOpResultin interfaceClientOpEventListener- Parameters:
clientOpInfo- The ClientOpEventInformation that generated the event.
-
onOpException
Description copied from interface:ClientOpEventListenerCalled if an exception is raised during the operation execution before giving a response to the client.- Specified by:
onOpExceptionin interfaceClientOpEventListener- Parameters:
clientOpInfo- The ClientOpEventInformation that generated the event.
-
onOpStartAnotherOperation
Description copied from interface:ClientOpEventListenerCalled when a failed operation implies to call another operation.- Specified by:
onOpStartAnotherOperationin interfaceClientOpEventListener- Parameters:
clientOpInfo- The ClientOpEventInformation that generated the event.
-