Search in sources :

Example 1 with Subscriber

use of org.apache.airavata.messaging.core.Subscriber in project airavata by apache.

the class RabbitMQListener method main.

public static void main(String[] args) {
    File file = new File("/tmp/latency_client");
    parseArguments(args);
    try {
        FileOutputStream fos = new FileOutputStream(file, false);
        final BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fos));
        String brokerUrl = ServerSettings.getSetting(RABBITMQ_BROKER_URL);
        System.out.println("broker url " + brokerUrl);
        final String exchangeName = ServerSettings.getSetting(RABBITMQ_EXCHANGE_NAME);
        List<String> routingKeys = getRoutingKeys(level);
        Subscriber subscriber = MessagingFactory.getSubscriber(message -> {
        }, routingKeys, Type.STATUS);
    } catch (ApplicationSettingsException e) {
        logger.error("Error reading airavata server properties", e);
    } catch (Exception e) {
        logger.error(e.getMessage(), e);
    }
}
Also used : ApplicationSettingsException(org.apache.airavata.common.exception.ApplicationSettingsException) Subscriber(org.apache.airavata.messaging.core.Subscriber) FileOutputStream(java.io.FileOutputStream) OutputStreamWriter(java.io.OutputStreamWriter) File(java.io.File) TException(org.apache.thrift.TException) IOException(java.io.IOException) ParseException(org.apache.commons.cli.ParseException) ApplicationSettingsException(org.apache.airavata.common.exception.ApplicationSettingsException) BufferedWriter(java.io.BufferedWriter)

Aggregations

BufferedWriter (java.io.BufferedWriter)1 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 OutputStreamWriter (java.io.OutputStreamWriter)1 ApplicationSettingsException (org.apache.airavata.common.exception.ApplicationSettingsException)1 Subscriber (org.apache.airavata.messaging.core.Subscriber)1 ParseException (org.apache.commons.cli.ParseException)1 TException (org.apache.thrift.TException)1