[[one_shot_channel_adaptor]]
== OneShotChannelAdaptor

Most host-to-host ISO-8583 links use persistent connections, and that's the
reason we have to multiplex the messages using a MUX, but for situations
where the host expects a single transaction per socket connection, we
have the +OneShotChannelAdaptor+.

The configuration and behavior is very similar to the +ChannelAdaptor+ (see <<channel_adaptor>>),
you just need to change the class name in the qbean descriptor.

It supports the following attributes:

.OneShotChannelAdaptor Attributes.
[cols="2,4", options="header"]
|===============
|Name|Attribute
|in|Input queue
|out|Output queue
|space|Optional space name, defaults to system's default space
|max-connections|Maximum number of simultaneous connections to the remote host, defaults to 1
|max-connect-attempts|Maximum number of connections attempts for a single transaction, defaults to 15
|===============

=== QBean descriptor

------------
<qbean name='your-channel' logger="Q2">
  class="org.jpos.q2.iso.OneShotChannelAdaptor"           <1>
 <channel class="org.jpos.iso.channel.NACChannel" 
       packager="org.jpos.iso.packager.GenericPackager" 
       header="6000000000">
  <property name="packager-config" 
           value="jar:packager/iso87binary.xml" />
  <property name="host" value="127.0.0.1" />
  <property name="port" value="8001" />                   
  <filter
      class="org.jpos.iso.filter.YourIncomingFilter" 
      direction="incoming" />
  <filter 
      class="org.jpos.iso.filter.YourOutgoingFilter" 
      direction="outgoing" />
 </channel>
 <in>your-channel-send</in>                               <2>
 <out>your-channel-receive</out>                          <3>
 <max-connections>5</max-connections>                     <4>
 <max-connect-attempts>3</max-connect-attempts>           <5>
</qbean>
------------
<1> Please note we specify a class here.
<2> Space queue used to receive messages to be transmitted to the
    remote endpoint.
<3> Messages received from the remote endpoint are placed in
    this queue.
<4> Overrides default max-connections (currently 1)
<5> Overrides default max-connect-attempts (currently 15)

[TIP]
=====
In addition to +org.jpos.q2.iso.OneShotChannelAdaptor+ there's 
a new experimental +org.jpos.q2.iso.OneShotChannelAdaptorMK2+ with
the same functionality and a new implementation.
=====

