Friday, 20 December 2013

Throttling in OSB -Control Number of Requests to Target service

Throttling 

              Throttling configured on Business Service only limited loads (requests) to back-end services and to avoid overloading the back-end.You can now “throttle” services and set priorities based on the caller. You can also manage service endpoints pools more effectively. 
Service Throttling
                       Service throttling is a new feature in Oracle Service Bus which allows to restrict the load for particular service. This has great value when it comes to Service up time.

Every system has its own capacity means it can process only certain number of message at one time, if we try to send messages beyond its capacity then that system's performance can degrade or in worst case it can crash. So to avoid all this we can use OSB throttling feature to send limited messages to target system.


To Enable Throttling to Business service or Proxy service

1.Create a Session Using Change center in OSb console.
2.Click on the Business Service/Proxy service you want to add throttling.
3.Go to Operational Settings tab.




4.Here 

1.Throttling State: 
  •  Enable or disable throttling for a business service.
Note: When you disable throttling for a business service at run time, all messages              in the throttling queue are processed without throttling.
2.Maximum Concurrency:
  • Restrict the number of messages that can be concurrently processed by a business service. This must be a positive integer. 
  • When this threshold is reached for a business service, all the incoming messages for the business service are placed in a throttling queue until the business service can accept more messages.
  • Any change to this setting affects both new messages and those already in the queue. When you increase the value, the Oracle Service Bus run time allows more messages to be sent to the business service after processing those in the queue first. 
  • When you decrease the value, the Oracle Service Bus run time places any new messages in a throttling queue until the concurrency setting goes below the new threshold, if you have defined a throttling queue. 
  • If you have not defined a throttling queue, the messages are discarded.
  • In a cluster environment, the number of messages that can be concurrently processed by a business service is equally divided among the managed servers.

Note: You can set this operational setting only if you enable throttling for the business service.

3.Throttling Queue (operational setting)

  • Restrict the number of messages in the throttling queue. The length of the throttling queue must be positive integer. 
  • All the incoming messages beyond the maximum concurrency limit for the business service are placed in the throttling queue. 
  • When the queue is full, the message in the queue with the lowest priority will be removed from the queue if a new incoming message has a higher priority.
  • If you set this length to be equal to zero, it implies that a throttling queue does not exist for the business service.
  • Any change to this setting is dynamically implemented. When you decrease the value for this setting, all the messages beyond the new length are discarded.

Note: You can set this operational setting only if you enable throttling for the business service.In a cluster environment, this is equally divided among the managed servers.

4.Message Expiration

  • Restrict the maximum time (in milliseconds) spent by a message in the throttling queue of a business service. This must be a positive integer. 
  • When this time has elapsed, the message is removed from the queue. These messages are referred to as expired messages.
  • If the message expiration is set to zero for a service, the messages in throttling queue for this service will never expire.
  • When you increase the value for this setting, the expiration time for the new messages and the messages that are already present in the queue is increased. 
  • When you decrease the value, all the messages that have exceeded the new value are immediately discarded.

Note: You can set this operational setting only if you enable throttling for the business service.


Example:Going to provide in next post...........