How to disable an operator in studio or to prevent an adapter from initializing.
book
Article ID: KB0075739
calendar_today
Updated On:
Description
How to disable an operator in studio or to prevent an adapter from initializing.
Issue/Introduction
How-to-disable-an-operator-in-studio-or-to-prevent-an-adapter-from-initializing
Resolution
There are two alternatives:
A. Disable the component in Studio
In SB Studio, you may right-click an output stream and choose "Disable Component". No tuples will be emitted and this stream will not appear for subscription.
This is not a property, but an attribute (example):
===
<output-stream disabled="true" name="OutputStream">
</output-stream>
===
...so there is no API or configuration to make this change in the context of a test harness.
Instead you would have to have the test modify the .sbapp XML as above before the application is loaded. It should restore the XML to the non-disabled state at the end of the test whether the test ends successfully or with a failure.
Through the SB Java API com.streambase.sb.client.StreamBaseAdminClient.modifyContainer() using setting "--dequeue=DISABLED" you may modify a whole container so that NONE of its output streams emits tuples.
B. Prevent an adapter from initializing
The solution for this requirement is to set the adapter property: General tab, "Start with application" = "No".
Then in those case where the adapter is needed to start, send in the "resume" administrative command. This can be done in the startup script you use to start the production application. The general mechanism to make sure commands like this occur AFTER the server is ready is to do so in a script:
StreamBase 7 example:
sbd ...
sleep {seconds}
sbadmin -u sb://host:port resume containerName[.moduleName].adapterName
Set the 'sleep' period to a reasonable amount of time to allow the server to report "Listening".
TIBCO Streaming 10.x example:
epadmin servicename=A.X start node
sleep {seconds}
epadmin servicename=A.X resume operator path=containerName[.moduleName].adapterName
Feedback
thumb_up
Yes
thumb_down
No