Last active
July 6, 2017 14:14
-
-
Save pjmuley/042d4c4b10c39d959f8e3eae541af987 to your computer and use it in GitHub Desktop.
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
String queueName="myQueue"; | |
String queueMessage="This is my test message"; | |
String brokerURI="https://mq-us-west-2.anypoint.mulesoft.com/api/v1/organizations/"; | |
brokerURI = brokerURI + orgId +"/environments/"+ envId +"/destinations/"+ queueName+"/messages"; | |
// Get message from existing queue using API | |
WebResource webResourceGet = client.resource(brokerURI); | |
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl(); | |
queryParams.add("poolingTime","10000"); | |
queryParams.add("batchSize","1"); | |
queryParams.add("lockTtl","10000"); | |
ClientResponse responseGet=webResourceGet.queryParams(queryParams) | |
.header("Authorization"," bearer" + access_token) | |
.type("application/json").accept("application/json").get(ClientResponse.class); | |
String outputGet = responseGet.getEntity(String.class); | |
System.out.println("Message Retrieved: \n" + outputGet); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment