Facing problem in redeclaring rabbit_mq exchange name

Hi,
I am new to elastic search. Please find below sample json format which
is used to create index in elastic search by using rabbitmq-river plugin.
In this code "vijay_exg" exchange is already exists in rabbitmq server.I
want to retrieve the messages from this exchange.When I am trying to
execute the below code it is generating error in elastic search log file

Sample Code :

curl -XPUT 'localhost:9200/_river/my_river/_meta' -d '{

"type" : "rabbitmq",
"rabbitmq" : {
"host" : "localhost",
"port" : 5672,
"user" : "guest",
"pass" : "guest",
"vhost" : "/",
"queue" : "vijay_test",
"exchange" : "vijay_exg",
"routing_key" : "routing_key",
"exchange_type" : "topic",
"exchange_durable" : true,
"queue_durable" : true,
"queue_auto_delete" : false,
"args" : {
"x-ha-policy" : "all"
}
},
"index" : {
"bulk_size" : 100,
"bulk_timeout" : "10ms",
"ordered" : false
}
}'

Error Message:

{amqp_error,precondition_failed,

        "cannot redeclare exchange 'vijay_exg' in vhost '/' with 

different type, durable, internal or autodelete value",

        'exchange.declare'}

Please help me.

Thanks & Regards,
Vijay

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

C.K.R.VIJAY Krishna wrote:

[...]

    "exchange" : "vijay_exg",
    "routing_key" : "routing_key",
    "exchange_type" : "topic",
    "exchange_durable" : true,
    "queue_durable" : true,
    "queue_auto_delete" : false,

[...]

Error Message:

{amqp_error,precondition_failed,

        "cannot redeclare exchange 'vijay_exg' in vhost '/' with 

different type, durable, internal or autodelete value",

        'exchange.declare'}

This means that you created the vijay_exg exchange previously using
parameters that don't match the ones in the river settings. You
probably didn't create it with durable=true, if I had to guess.

Rabbit wants each of those things to match up for exchanges and
queues.

-Drew

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Drew,
Thanks for your reply. Now I have created new exchange "vijay_exh1"
as durable in rabbit MQ Server and made rabbit_mq queue as durable.
In the above sample code I made "exchange_durable" :true "queue_durable" :
true, and started publishing messages in exchange "vijay_exh1" but I can't
able to consume messages in Elasticsearch and there is no error in elastic
search log file.Please help me.

sample code :

curl -XPUT 'http://localhost:9200/_river/my_cdr/_meta' -d '{
"type" : "rabbitmq",
"rabbitmq" : {
"host" : "localhost",
"port" : 5672,
"user" : "guest",
"pass" : "guest",
"vhost" : "/",
"queue" : "vijay_test",
"exchange" : "vijay_exh1",
"routing_key" : "call.cdr.*",
"exchange_type" : "topic",
"exchange_durable" :true,
"queue_durable" : true,
"queue_auto_delete" : false,
"args" : {
"x-ha-policy" : "all"
}
},
"index" : {
"bulk_size" : 100,
"bulk_timeout" : "10ms",
"ordered" : false
}
}'

Thanks & Regards,
Vijay.

On Friday, February 15, 2013 10:01:38 AM UTC-5, C.K.R.VIJAY Krishna wrote:

Hi,
I am new to Elasticsearch. Please find below sample json format which
is used to create index in Elasticsearch by using rabbitmq-river plugin.
In this code "vijay_exg" exchange is already exists in rabbitmq server.I
want to retrieve the messages from this exchange.When I am trying to
execute the below code it is generating error in Elasticsearch log file

Sample Code :

curl -XPUT 'localhost:9200/_river/my_river/_meta' -d '{

"type" : "rabbitmq",
"rabbitmq" : {
"host" : "localhost",
"port" : 5672,
"user" : "guest",
"pass" : "guest",
"vhost" : "/",
"queue" : "vijay_test",
"exchange" : "vijay_exg",
"routing_key" : "routing_key",
"exchange_type" : "topic",
"exchange_durable" : true,
"queue_durable" : true,
"queue_auto_delete" : false,
"args" : {
"x-ha-policy" : "all"
}
},
"index" : {
"bulk_size" : 100,
"bulk_timeout" : "10ms",
"ordered" : false
}
}'

Error Message:

{amqp_error,precondition_failed,

        "cannot redeclare exchange 'vijay_exg' in vhost '/' with 

different type, durable, internal or autodelete value",

        'exchange.declare'}

Please help me.

Thanks & Regards,
Vijay

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

C.K.R.VIJAY Krishna wrote:

Thanks for your reply. Now I have created new exchange "vijay_exh1"
as durable in rabbit MQ Server and made rabbit_mq queue as durable.
In the above sample code I made "exchange_durable" :true
"queue_durable" : true, and started publishing messages in exchange
"vijay_exh1" but I can't able to consume messages in Elasticsearch
and there is no error in Elasticsearch log file.Please help me.

If you're not getting errors in rabbit log or ES log, then it's
likely you're publishing messages that aren't routing properly within
rabbit.

Use the rabbit web interface or calls to:

rabbitmqctl list_queues -p / messages messages_unacknowledged name

to see if the vijay_test queue is accumulating messages. If it
isn't, and no other queue is catching them, then they're probably
getting dropped by the exchange.

-Drew

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi,
Thanks for your reply Drew. I have restarted the Elasticsearch server and
noticed following error message in Elasticsearch log file and in rabbitmq
queue i have noticed 8 unacknowledged messages.

[WARN ][river.rabbitmq ] [elasticserver] [rabbitmq][my_cdr] failed to
execute bulk for delivery tags [[8]], not ack'ing
org.elasticsearch.action.ActionRequestValidationException: Validation
Failed: 1: no requests added;
at
org.elasticsearch.action.ValidateActions.addValidationError(ValidateActions.java:29)
at
org.elasticsearch.action.bulk.BulkRequest.validate(BulkRequest.java:375)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:55)
at
org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:92)
at
org.elasticsearch.client.support.AbstractClient.bulk(AbstractClient.java:145)
at
org.elasticsearch.action.bulk.BulkRequestBuilder.doExecute(BulkRequestBuilder.java:129)
at
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:62)
at
org.elasticsearch.river.rabbitmq.RabbitmqRiver$Consumer.run(RabbitmqRiver.java:291)
at java.lang.Thread.run(Thread.java:722).

Thanks & Regards,
Vijay

On Monday, February 18, 2013 9:56:13 AM UTC-5, Drew Raines wrote:

C.K.R.VIJAY Krishna wrote:

Thanks for your reply. Now I have created new exchange "vijay_exh1"
as durable in rabbit MQ Server and made rabbit_mq queue as durable.
In the above sample code I made "exchange_durable" :true
"queue_durable" : true, and started publishing messages in exchange
"vijay_exh1" but I can't able to consume messages in Elasticsearch
and there is no error in Elasticsearch log file.Please help me.

If you're not getting errors in rabbit log or ES log, then it's
likely you're publishing messages that aren't routing properly within
rabbit.

Use the rabbit web interface or calls to:

rabbitmqctl list_queues -p / messages messages_unacknowledged name

to see if the vijay_test queue is accumulating messages. If it
isn't, and no other queue is catching them, then they're probably
getting dropped by the exchange.

-Drew

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

C.K.R.VIJAY Krishna wrote:

Thanks for your reply Drew. I have restarted the Elasticsearch
server and noticed following error message in Elasticsearch log
file and in rabbitmq queue i have noticed 8 unacknowledged
messages.

[WARN ][river.rabbitmq ] [elasticserver] [rabbitmq][my_cdr] failed to
execute bulk for delivery tags [[8]], not ack'ing
org.elasticsearch.action.ActionRequestValidationException: Validation
Failed: 1: no requests added;

OK, this means the payload in your rabbit messages is not valid bulk
format. Can you gist the exact payload of one of those messages? If
it's sensitive data, perhaps the code you use to generate them?

-Drew

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Drew,
Please find below sample payload code which I am getting.
Sample code.
{
"Digits-Dialed": "none",
"Ringing-Seconds": "2",
"Billing-Seconds": "4",
"Duration-Seconds": "7",
"From-Uri": "vijay_test_zoiper@dev.local",
"To-Uri": "1@2.dev.local",
"Call-Direction": "inbound",
"Timestamp": "12345",
"Callee-ID-Number": "+134567",
"Callee-ID-Name": "Vijaya",
"Caller-ID-Number": "vijay_test_zoiper",
"Caller-ID-Name": "Vijaya Krishna",
"Local-SDP": "v=0\no=FreeSWITCH IN IP4 11.21.122.17\ns=FreeSWITCH\nc=IN
IP4 \nt=0 0\n",
"Remote-SDP": "v=0\r\no=Zoiper_user 0 1 IN IP4
11.11.12.6\r\ns=Zoiper_session\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\n",
"Custom-Channel-Vars": {
"Authorizing-Type": "device",
"Account-ID": "accid",
"Username": "vijay_test_zoiper",
}
}

Can you please provide one sample payload code . I have tied to publish
message based on below url but no use.

https://github.com/elasticsearch/elasticsearch-river-rabbitmq/issues/7

Publishing messages to rabbitmq using restclient(firebug plugin) .Please
help me.

Thanks & Regards,
Vijay.

On Tuesday, February 19, 2013 2:49:42 PM UTC-5, Drew Raines wrote:

C.K.R.VIJAY Krishna wrote:

Thanks for your reply Drew. I have restarted the Elasticsearch
server and noticed following error message in Elasticsearch log
file and in rabbitmq queue i have noticed 8 unacknowledged
messages.

[WARN ][river.rabbitmq ] [elasticserver] [rabbitmq][my_cdr] failed to
execute bulk for delivery tags [[8]], not ack'ing
org.elasticsearch.action.ActionRequestValidationException: Validation
Failed: 1: no requests added;

OK, this means the payload in your rabbit messages is not valid bulk
format. Can you gist the exact payload of one of those messages? If
it's sensitive data, perhaps the code you use to generate them?

-Drew

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

C.K.R.VIJAY Krishna wrote:

Please find below sample payload code which I am getting.
Sample code.
{
"Digits-Dialed": "none",
"Ringing-Seconds": "2",
"Billing-Seconds": "4",
"Duration-Seconds": "7",

[...]

Can you please provide one sample payload code . I have tied to
publish message based on below url but no use.

The payload needs to be a proper bulk request similar to what you'd
send using curl. Have a look at the bulk api docs for the specifics.
I'll provide a short example below.

https://github.com/elasticsearch/elasticsearch-river-rabbitmq/issues/7

This issue highlights a common issue people have with bulk: newlines
are significant! If you have them in your json document, they need
to be properly escaped (which should happen automatically when you
encode using your favorite library). For example, take this json
object:

{"foo": "bar\nbaz"}

When encoded to a string, it should look like:

"{"foo":"bar\nbaz"}"

And then to send it with bulk, add meta and the proper newline
separation. The literal string you would put in your rabbit msg
would look something like this:

"{"index":{"_index":"test","_type":"t"}}\n{"foo":"foo\nbar"}\n"

You can repeat that for as many docs as you want in your request.

Don't forget the trailing newline!

-Drew

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Drew,
Thank you drew. I can able to post a message to rabbit Mq queue and
Index the message using rabbitmq river plugin .

Thanks & Regards,
Vijay.

On Friday, February 15, 2013 10:01:38 AM UTC-5, C.K.R.VIJAY Krishna wrote:

Hi,
I am new to Elasticsearch. Please find below sample json format which
is used to create index in Elasticsearch by using rabbitmq-river plugin.
In this code "vijay_exg" exchange is already exists in rabbitmq server.I
want to retrieve the messages from this exchange.When I am trying to
execute the below code it is generating error in Elasticsearch log file

Sample Code :

curl -XPUT 'localhost:9200/_river/my_river/_meta' -d '{

"type" : "rabbitmq",
"rabbitmq" : {
"host" : "localhost",
"port" : 5672,
"user" : "guest",
"pass" : "guest",
"vhost" : "/",
"queue" : "vijay_test",
"exchange" : "vijay_exg",
"routing_key" : "routing_key",
"exchange_type" : "topic",
"exchange_durable" : true,
"queue_durable" : true,
"queue_auto_delete" : false,
"args" : {
"x-ha-policy" : "all"
}
},
"index" : {
"bulk_size" : 100,
"bulk_timeout" : "10ms",
"ordered" : false
}
}'

Error Message:

{amqp_error,precondition_failed,

        "cannot redeclare exchange 'vijay_exg' in vhost '/' with 

different type, durable, internal or autodelete value",

        'exchange.declare'}

Please help me.

Thanks & Regards,
Vijay

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.