Ejemplo n.º 1
0
    ClientCurrent(final boolean autoConsumeEnabled, final String connectString) {
      conf =
          new org.apache.hedwig.client.conf.ClientConfiguration() {
            @Override
            public boolean isAutoSendConsumeMessageEnabled() {
              return autoConsumeEnabled;
            }

            @Override
            public int getConsumedMessagesBufferSize() {
              return 1;
            }

            @Override
            protected HedwigSocketAddress getDefaultServerHedwigSocketAddress() {
              return new HedwigSocketAddress(connectString);
            }
          };
      client = new org.apache.hedwig.client.HedwigClient(conf);
      publisher = client.getPublisher();
      subscriber = client.getSubscriber();
    }
Ejemplo n.º 2
0
 void close() throws Exception {
   if (null != client) {
     client.close();
   }
 }