Re: missing amqp-exchange on bucket-notification with AMQP endpoint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andreas,
The message format you tried to use is the standard one (the one being
emitted from boto3, or any other AWS SDK [1]).
It passes the arguments using 'x-www-form-urlencoded'. For example:

POST / HTTP/1.1
Host: localhost:8000

Accept-Encoding: identity
Date: Tue, 21 Apr 2020 08:52:35 GMT
Content-Length: 293

Content-Type: application/x-www-form-urlencoded; charset=utf-8

Authorization: AWS KOC0EIWUFANCC3FX:8PunIZ4F36uK2c+3AKwhaKXgK84=

User-Agent: Boto3/1.9.225 Python/2.7.17 Linux/5.5.13-200.fc31.x86_64
Botocore/1.15.28

Name=ajmmvc-1_topic_1&
Attributes.entry.2.key=amqp-exchange&
Attributes.entry.1.key=amqp-ack-level&
Attributes.entry.2.value=amqp.direct&
Version=2010-03-31&
Attributes.entry.3.value=amqp%3A%2F%2F127.0.0.1%3A7001&
Attributes.entry.1.value=none&
Action=CreateTopic&
Attributes.entry.3.key=push-endpoint

Note that the arguments are passed inside the message body (no '?' in the
URL), and are using the "Attributes" for all the non-standard parameters we
added on top of the standard AWS topic creation command.

The format that worked for you, is a non-standard one that we support, as
documented for pubsub [2], which is using regular URL encoded parameters.
Feel free to use either, but would recommend on the standard one.

Anyway, thanks for pointing this confusion, will clarify that in the doc,
and also fix the 'push-endpoint' part.

Yuval

[1] https://docs.aws.amazon.com/sns/latest/api/API_CreateTopic.html
[2] https://docs.ceph.com/docs/master/radosgw/pubsub-module/#create-a-topic


On Mon, Apr 20, 2020 at 8:05 PM Andreas Unterkircher <unki@xxxxxxxxxxxxx>
wrote:

> I've tried to debug this a bit.
>
> >                  <EndPoint>
> > <EndpointAddress>amqp://
> rabbitmquser:rabbitmqpass@xxxxxxxxxxxxxxxxxxxx:5672</EndpointAddress>
> >
> <EndpointArgs>Attributes.entry.1.key=amqp-exchange&amp;Attributes.entry.1.value=amqp.direct&amp;push-endpoint=amqp://
> rabbitmquser:rabbitmqpass@xxxxxxxxxxxxxxxxxxxx:5672</EndpointArgs>
> >                      <EndpointTopic>testtopic</EndpointTopic>
> >                  </EndPoint>
>
> For the above I was using the following request to create the topic -
> similar as it is described here [1]:
>
>
> https://ceph.example.com/?Action=CreateTopic&Name=testtopic&Attributes.entry.1.key=amqp-exchange&Attributes.entry.1.value=amqp.direct&push-endpoint=amqp://rabbitmquser:rabbitmqpass@xxxxxxxxxxxxxxxxxxxx:5672
>
> (of course endpoint then URL-encoded)
>
> It seems to me that RGWHTTPArgs::parse() is not translating the
> "Attributes.entry.1..." strings into keys & values in its map.
>
> This are the keys & values that can now be found in the map:
>
>
> Found name:  Attributes.entry.1.key
> Found value: amqp-exchange
> Found name:  Attributes.entry.1.value
> Found value: amqp.direct
> Found name:  push-endpoint
> Found value: amqp://rabbitmquser:rabbitmqpass@xxxxxxxxxxxxxxxxxxxx:5672
>
> If I simply change the request to:
>
>
> https://ceph.example.com/?Action=CreateTopic&Name=testtopic&amqp-exchange=amqp.direct&push-endpoint=amqp://rabbitmquser:rabbitmqpass@xxxxxxxxxxxxxxxxxxxx:5672/foobar
>
> -> at voila, the entries in the map are correct
>
>
> Found name:  amqp-exchange
> Found value: amqp.direct
> Found name:  push-endpoint
> Found value: amqp://rabbitmquser:rabbitmqpass@xxxxxxxxxxxxxxxxxxxx:5672
>
> And then the bucket-notification works like it should.
>
> But I don't think the documentation is wrong, or is it?
>
> Cheers,
> Andreas
>
>
> [1]
> https://docs.ceph.com/docs/master/radosgw/notifications/#create-a-topic
>
>
>
> [2] Index: ceph-15.2.1/src/rgw/rgw_common.cc
> ===================================================================
> --- ceph-15.2.1.orig/src/rgw/rgw_common.cc
> +++ ceph-15.2.1/src/rgw/rgw_common.cc
> @@ -810,6 +810,8 @@ int RGWHTTPArgs::parse()
>         string& name = nv.get_name();
>         string& val = nv.get_val();
>
> +      cout << "Found name:  " << name << std::endl;
> +      cout << "Found value: " << val << std::endl;
>         append(name, val);
>       }
> _______________________________________________
> ceph-users mailing list -- ceph-users@xxxxxxx
> To unsubscribe send an email to ceph-users-leave@xxxxxxx
>
_______________________________________________
ceph-users mailing list -- ceph-users@xxxxxxx
To unsubscribe send an email to ceph-users-leave@xxxxxxx



[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Ceph Dev]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux