Chapter 6. KSB

Table of Contents

How to Use the KSB
Introduction
Bean Based Services
Diagram Notes
Details of Supported Service Protocols
Java Rice Client
Any Java Client
Non-Java/Non-Rice Client
Future Enhancement to KSB: Remote the KSB Registry as a Service
Additional Options Once Registry is a Service:
Configuring the KSB Client in Spring
Overview
Spring Property Configuration
Spring JTA Configuration
Put JTA and the Rice Config object in the RiceConfigurer
Configuring KSB without JTA
web.xml Configuration
Configuration Parameters
KSBConfigurer Properties
KSB Configurer
Configuring Quartz for KSB
Quartz Scheduling
Acquiring and Invoking Services Deployed on KSB
Service invocation overview
Acquiring and invoking a service directly
Acquiring and invoking a service using messaging
Getting responses from service calls made with messaging
Failover
Service call failover
Failover with queues
Failover with topics
KSB Clustered Caching Using OSCache
Distributed caching using the KSB wrapper classes and Spring configuration
Configuring the OSCache behind the scenes
Using OSCache directly and using the bus to distribute cache notifications
KSB Exception Messaging
KSB Messaging Paradigms
Queues
Topics
Message Fetcher
Load Balancing
Object Remoting
Publishing Services to KSB
KSBConfigurer
KSBExporter
ServiceDefinition properties
ServiceNameSpaceURI/MessageEntity
SOAPServiceDefinition
JavaServiceDefinition
Publishing Rice services
Store and Forward
Overview
Implementation
The ResourceLoader Stack
Overview
Accessing and overriding Rice services and beans from Spring
Distributed Caching Implementation
KSB Security
Overview
Security types
CredentialsSource
KSB connector and exporter code
Bus Security
Queue and Topic invocation
Queue invocation
Topic invocation
KSB Parameters
Core Parameters
KSB Configurer Properties
JAX-RS / RESTful services
Caveats
A Simple Example
Composite Services
Additional Service Definition Properties

How to Use the KSB

Introduction

The Kuali Service Bus (KSB) is a lightweight service bus designed to allow developers to quickly develop and deploy services for remote and local consumption. You can deploy services to the bus using Spring or programmatically. Services must be named when they are deployed to the bus. Services are acquired from the bus using their name.

At the heart of the KSB is a service registry. This registry is a listing of all services available for consumption on the bus. The registry provides the bus with the information necessary to achieve load balancing, failover and more.

Bean Based Services

Typically, KSB programming is centered on exposing Spring-configured beans to other calling code using a number of different protocols. Using this paradigm the client developer and the organization can rapidly build and consume services, often a daunting challenge using other buses.

Figure 6.1. Overview of Supported Service Protocols

Overview of Supported Service Protocols


Diagram Notes

This drawing is conceptual and not representative of a true deployment architecture. Essentially, the KSB is a registry with service calling behavior on the client end (Java client). All policies and behaviors (Asynchronous as opposed to Synchronous) are coordinated on the client. The client offers some very attractive messaging features:

  • Synchronization of message sending with currently running transaction (meaning all messages sent during a transaction are ONLY sent if the transaction is successfully committed)

  • Failover - If a call to a service comes back with a 404 (or various other network-related errors), it will try to call other services of the same name on the bus. This is for both sync and async calls.

  • Load balancing - Clients will round-robin call services of the same name on the bus. Proxy instances, however, are bound to single machines if you want to keep a line of communication open to a single machine for long periods of time.

  • Topics and Queues

  • Persistent messages - When using message persistence a message cannot be lost. It will be persisted until it is sent.