book
Article ID: KB0076347
calendar_today
Updated On:
Description
What is the best way to integrate Spring components with StreamBase applications?
Issue/Introduction
Package Spring components in jar files referenced by the TIBCO Streaming project
Resolution
StreamBase EventFlow applications are extended using custom Java within the context of operators, embedded adapters, and functions.
The best way to make use of Spring is to develop your Spring components in java projects independent from StreamBase projects, compile and package your Spring components into jars, and then reference these jars when developing StreamBase operators, adapters, and functions. Access to the beans will not be exposed within the EventFlow or expression language directly, as the operator, adapter, and function code will marshal the data between the bean and the tuple format.
One important tip is to avoid invoking Spring facilities within the embedded adapter typecheck() method, as this will be invoked frequently when editing the adapter in StreamBase Studio. If possible, interact with Spring components only within the operator or adapter's run() method. Similarly, do not try to override the types of properties, number of ports, or schemas from Spring configuration external to those configuration facilities provided by Studio, as that will certainly confuse Studio and likely result in EventFlow that fails due to typecheck errors at runtime.