开发者

amqp_login giving "Argument list too long" error?

I am using c library of RabbitMQ. It has a function amqp_login

I am using it as following.

 ::amqp_rpc_reply_t c_amqp_rpc_reply = 
                       ::amqp_login
                             ( m_amqp_connection_state
                             , "fortytwo"
                           开发者_运维百科  , 0
                             , FRAME_MAX
                             , 0
                             , 131072
                             , "guest"
                             , "guest"
                             );

Its giving me error as Argument list too long.

Any one have any idea to fix this.


It would really help to know the version of librabbitmq you're using.

The current version has this prototype for amqp_login, so your sixth parameter (131072) looks suspicious.

RABBITMQ_EXPORT amqp_rpc_reply_t amqp_login(amqp_connection_state_t state,
                                            char const *vhost,
                                            int channel_max,
                                            int frame_max,
                                            int heartbeat,
                                            amqp_sasl_method_enum sasl_method, ...);

Looking at the examples, I guess you probably want:

amqp_login(conn, "/", 0, 131072, 0,
           AMQP_SASL_METHOD_PLAIN,
           "guest", "guest");

You could also try the new fangled AMQP URI parser. Again, look at the examples to see how it's used.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜