This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package com.lynden.jenkins; | |
import hudson.Extension; | |
import hudson.model.AbstractProject; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package com.lynden.jenkins; | |
import hudson.Extension; | |
import hudson.model.AbstractProject; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void startBroker() throws Exception { | |
context.addComponent("jms-broker", activeMQComponent("vm://localhost?broker.persistent=false")); | |
buildProducerRoute(context); | |
buildConsumerRoute(context); | |
context.start(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void buildProducerRoute(CamelContext context) throws Exception { | |
context.addRoutes(new RouteBuilder() { | |
@Override | |
public void configure() throws Exception { | |
Processor processor = (Exchange exchange) -> { | |
System.out.println("PRODUCER Received response: " + exchange.getIn().getBody(String.class)); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void buildConsumerRoute(CamelContext context) throws Exception { | |
context.addRoutes(new RouteBuilder() { | |
@Override | |
public void configure() throws Exception { | |
Processor processor = (Exchange exchange) -> { | |
System.out.println("CONSUMER received message: " + exchange.getIn().getBody(String.class)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void startBroker() throws Exception { | |
context = new DefaultCamelContext(); | |
context.addComponent("jms-broker", activeMQComponent("vm://localhost?broker.persistent=false")); | |
buildProducerRoute(context); | |
buildConsumerRoute(context); | |
context.start(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void buildConsumerRoute(CamelContext context) throws Exception { | |
context.addRoutes(new RouteBuilder() { | |
@Override | |
public void configure() throws Exception { | |
Processor processor = (Exchange exchange) -> { | |
System.out.println("CONSUMER received message: " + exchange.getIn().getBody(String.class)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String getWildflyVersion() { | |
WebTarget target = getClient().target("http://localhost:19990/management").queryParam("operation", "attribute").queryParam("name", "product-version"); | |
Response response = target.request(MediaType.APPLICATION_JSON).get(); | |
return response.readEntity(String.class); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected static ResteasyClient getClient() { | |
CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); | |
UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("admin", "adminadmin"); | |
credentialsProvider.setCredentials(AuthScope.ANY, credentials); | |
HttpClient httpclient = HttpClientBuilder.create().setDefaultCredentialsProvider(credentialsProvider).build(); | |
ApacheHttpClient4Engine engine = new ApacheHttpClient4Engine(httpclient, true); | |
return new ResteasyClientBuilder().httpEngine(engine).build(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected static ResteasyClient getClient() { | |
CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); | |
UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("adminUser", "adminPassword"); | |
credentialsProvider.setCredentials(AuthScope.ANY, credentials); | |
HttpClient httpclient = HttpClientBuilder.create().setDefaultCredentialsProvider(credentialsProvider).build(); | |
ApacheHttpClient4Engine engine = new ApacheHttpClient4Engine(httpclient, true); | |
return new ResteasyClientBuilder().httpEngine(engine).build(); | |
} |
OlderNewer