org.robokind.impl.messaging
Class JMSAvroRecordSender<T extends org.apache.avro.generic.IndexedRecord>

java.lang.Object
  extended by org.robokind.impl.messaging.JMSAvroRecordSender<T>
Type Parameters:
T - type of Avro Record to send
All Implemented Interfaces:
org.robokind.api.messaging.RecordSender<T>

public class JMSAvroRecordSender<T extends org.apache.avro.generic.IndexedRecord>
extends Object
implements org.robokind.api.messaging.RecordSender<T>

Sends Avro Records over JMS (Qpid).

Author:
Matthew Stevenson

Constructor Summary
JMSAvroRecordSender(JMSBytesMessageSender sender)
          Creates a new JMSAvroRecordSender.
 
Method Summary
 void sendRecord(T record)
          Serializes the given Avro Record to a byte array, packs it into a JMS BytesMessage, and sends it to the JMS Destination.
 void sendRecord(T record, String contentType)
          Packs the given Avro Record into a JMS BytesMessage and sends it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMSAvroRecordSender

public JMSAvroRecordSender(JMSBytesMessageSender sender)
Creates a new JMSAvroRecordSender.

Parameters:
sender - JMSBytesSender to send Records
Method Detail

sendRecord

public void sendRecord(T record)
Serializes the given Avro Record to a byte array, packs it into a JMS BytesMessage, and sends it to the JMS Destination.

Specified by:
sendRecord in interface org.robokind.api.messaging.RecordSender<T extends org.apache.avro.generic.IndexedRecord>
Parameters:
record - the Avro Record to send

sendRecord

public void sendRecord(T record,
                       String contentType)
Packs the given Avro Record into a JMS BytesMessage and sends it.

Parameters:
record - Record to send
contentType - optional content type for the JMS header


Copyright © 2011-2013. All Rights Reserved.