use of com.rabbitmq.http.client.ClientParameters in project tutorials by jhkim105.
the class RabbitClientTest method delete.
@Test
void delete() throws Exception {
String apiUrl = "http://localhost:15672/api";
String username = "guest";
String password = "guest";
Client client = new Client(new ClientParameters().url(apiUrl).username(username).password(password));
List<QueueInfo> queueInfoList = client.getQueues();
queueInfoList.forEach(qi -> client.deleteQueue("/", qi.getName()));
}
use of com.rabbitmq.http.client.ClientParameters in project hop by rabbitmq.
the class SanityCheck method main.
public static void main(String[] args) {
try {
Client c = new Client(new ClientParameters().url("http://127.0.0.1:15672/api/").username("guest").password("guest"));
c.getOverview();
LoggerFactory.getLogger("rabbitmq").info("Test succeeded with Hop {}", Client.class.getPackage().getImplementationVersion());
System.exit(0);
} catch (Exception e) {
LoggerFactory.getLogger("rabbitmq").info("Test failed", e);
System.exit(1);
}
}
use of com.rabbitmq.http.client.ClientParameters in project hop by rabbitmq.
the class AppTest method createUseClient.
@Test
void createUseClient() throws Exception {
HttpLayerFactory httpLayerFactory = JdkHttpClientHttpLayer.configure().clientBuilderConsumer(clientBuilder -> clientBuilder.connectTimeout(Duration.ofSeconds(10))).requestBuilderConsumer(requestBuilder -> requestBuilder.timeout(Duration.ofSeconds(10)).setHeader("Authorization", authorization("guest", "guest"))).create();
Client c = new Client(new ClientParameters().url("http://127.0.0.1:15672/api/").username("guest").password("guest").httpLayerFactory(httpLayerFactory));
c.getOverview();
}
Aggregations