public class JmsWriter extends DataWriter
Records to a Java Message Service (JMS) provider.DataEndpoint.StatelastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEYBUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZEid, log, name, TIMESTAMP_FORMAT| Constructor and Description |
|---|
JmsWriter(JmsSettings settings)
Connects to a Java Message Service server.
Apache ActiveMQ Example:
Properties props = new Properties(); |
| Modifier and Type | Method and Description |
|---|---|
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a
DataException. |
void |
close()
Indicates that this endpoint has finished reading or writing.
|
JmsConnection |
getConnection() |
JmsSettings |
getSettings() |
void |
open()
Makes this endpoint ready for reading or writing.
|
protected void |
writeImpl(Record record)
Overridden by subclasses to write the specified record to this
DataWriter. |
available, getNestedEndpoint, getNestedWriter, getRootEndpoint, getRootWriter, getWriter, writedecrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, resetRecordCount, toStringaddElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescriptionpublic JmsWriter(JmsSettings settings)
Properties props = new Properties();
props.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.apache.activemq.jndi.ActiveMQInitialContextFactory");
props.setProperty(Context.PROVIDER_URL,"tcp://localhost:61616");
DataWriter writer = new JmsWriter(props, JmsDestinationType.TOPIC, "topicName");
Read your JMS provider manual for more details
properties - the properties required by the JMS servertype - the type of messaging useddestinationName - the name of the Topic or QueueJmsDestinationTypepublic JmsSettings getSettings()
public JmsConnection getConnection()
public void open()
throws DataException
DataEndpointopen in class DataEndpointDataExceptionpublic void close()
throws DataException
DataEndpointclose in class DataEndpointDataExceptionprotected void writeImpl(Record record) throws Throwable
DataWriterDataWriter.writeImpl in class DataWriterThrowablepublic DataException addExceptionProperties(DataException exception)
EndpointDataException. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties in class DataWriterCopyright (c) 2006-2025 North Concepts Inc. All Rights Reserved.