[rabbitmq-discuss] Dynamic Shovels

Smithnosky, Jesse Jesse.Smithnosky at emc.com
Fri Apr 18 01:15:41 BST 2014


Hi Everyone,

I'm trying to get the new (in version 3.3) Dynamic Shovels feature up and running, but I'm seeing some weird behavior using curl and not having much luck setting it up in java either.  Here is the curl command I am trying:

curl -i -u guest:guest -H "content-type:application/json" -XPUT -d'{"value":{"src-uri":"amqp://","src-queue":"my-queue","dest-uri":"amqp://remote-server","dest-queue":"another-queue"}}' http://localhost:15672/api/parameters/shovel/%2f/edShovel
HTTP/1.1 204 No Content
Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
Date: Thu, 17 Apr 2014 23:16:58 GMT
Content-Type: application/json
Content-Length: 0

It appears that the shovel is getting created correctly, but a 204 is coming back.  This is really just a proof of concept, but it has me a little worried about whether or not I can get it working in Java.  I'm trying to do something like this:

    String jsonString = jackson.writeValueAsString(shovel);
    HttpClient client = HttpClientBuilder.create().build();
    HttpPost post = new HttpPost(RABBIT_URL_BASE+vhost+"/"+shovelName);
    post.setEntity(new StringEntity(jsonString));
    post.addHeader("content-type", "application/json");
    String userPassword = "guest:guest";
    String encoding = DatatypeConverter.printBase64Binary(userPassword.getBytes("UTF-8"));
    post.setHeader( "Authorization", "Basic " + encoding );
    HttpResponse response = client.execute(post);

No matter what I seem to do, however, I'm getting back a 405 Method not allowed response.  Has anyone gotten these working yet?  Am I doing something obvious incorrectly?  Any help is appreciated.

Thanks,
Jesse
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140417/b5a1e338/attachment.html>


More information about the rabbitmq-discuss mailing list