10.07.2015 Views

Using TCP Adapters with Ensemble - InterSystems Documentation

Using TCP Adapters with Ensemble - InterSystems Documentation

Using TCP Adapters with Ensemble - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Using</strong> the <strong>TCP</strong> Text Line Outbound Adapter• Enter a package and class name and click Next.Important:Be sure to avoid reserved package names; see “Reserved Package Names” in Developing<strong>Ensemble</strong> Productions.• Choose EnsLib.<strong>TCP</strong>.TextLineOutboundAdapter from the drop-down list of adapter classes.• Choose the default invocation style Queue. The alternative is InProc, but generally you want Queue. The differencesare as follows:– Queue means the message is created <strong>with</strong>in one background job and placed on a queue, at which time theoriginal job is released. Later, when the message is processed, a different background job will be allocatedfor the task.– InProc means the message will be formulated, sent, and delivered in the same job in which it was created.The job will not be released to the sender’s pool until the message is delivered to the target. This is onlysuitable for special cases.• Add at least one entry to the method map as follows:–Click the Add icon.– Enter the method name.– Choose a request type and a response type.– Click OK.Repeat these steps as needed to add entries to the method map.• Click Finish.The result is a template class like the following:Class Dev.Test.NewOperation1 Extends Ens.BusinessOperation [ ProcedureBlock ]{Parameter ADAPTER = "EnsLib.<strong>TCP</strong>.TextLineOutboundAdapter";Parameter INVOCATION = "Queue";Method SampleCall(pRequest As Ens.Request,Output pResponse As Ens.Response) As %Status{Quit $$$ERROR($$$NotImplemented)}XData MessageMap{SampleCall}}2. Implement the method(s) in your new business operation class.Where the following line appears, replace it <strong>with</strong> your own code:Quit $$$ERROR($$$NotImplemented)Keep in mind that the method must quit by returning a %Status object.46 <strong>Using</strong> <strong>TCP</strong> <strong>Adapters</strong> <strong>with</strong> <strong>Ensemble</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!