org.apache.qpid.example.publisher
Class FileMessageDispatcher
java.lang.Object
org.apache.qpid.example.publisher.FileMessageDispatcher
public class FileMessageDispatcher
- extends Object
Class that sends message files to the Publisher to distribute
using files as input
Must set properties for host in properties file or uses in vm broker
Method Summary |
static void |
cleanup()
Cleanup before exit |
static void |
main(String[] args)
To use this main method you need to specify a path or file to use for input
This class then uses file contents from the dir/file specified to generate
messages to publish
Intended to be a very simple way to get going with publishing using the broker |
static void |
publish(String path)
Publish the content of a file or files from a directory as messages |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_logger
protected static final org.slf4j.Logger _logger
_publisher
protected static Publisher _publisher
FileMessageDispatcher
public FileMessageDispatcher()
main
public static void main(String[] args)
- To use this main method you need to specify a path or file to use for input
This class then uses file contents from the dir/file specified to generate
messages to publish
Intended to be a very simple way to get going with publishing using the broker
- Parameters:
args
- - must specify one value, the path to file(s) for publisher
publish
public static void publish(String path)
throws JMSException,
MessageFactoryException
- Publish the content of a file or files from a directory as messages
- Parameters:
path
- - from main args
- Throws:
JMSException
MessageFactoryException
- - if cannot create message from file content
cleanup
public static void cleanup()
- Cleanup before exit
Licensed to the Apache Software Foundation