Stratio / spark-rabbitmq

RabbitMQ Spark Streaming receiver
Apache License 2.0
208 stars 84 forks source link

can't set vhost of rabbitmq #125

Closed steelxiang closed 5 years ago

steelxiang commented 5 years ago

this is code

` val hosts="180.100.230.179" val queueName="hdfs" val exchangeName="myExchange" val exchangeType="direct" val password="rabbitmq" val userName="root" val vHost="myHost" val routingKeys="hello"

val receiverStream: ReceiverInputDStream[String] = RabbitMQUtils.createStream(ssc, Map( "hosts" -> hosts, "queueName" -> queueName, "exchangeName" -> exchangeName, "exchangeType" -> exchangeType, "routingKeys" ->routingKeys, "password" -> password, "userName" -> userName, "vHost" -> vHost ))

`

this is error show

com.rabbitmq.client.ShutdownSignalException: connection error; protocol method: #method(reply-code=530, reply-text=NOT_ALLOWED - access to vhost '/' refused for user 'root', class-id=10, method-id=40)

I set the val vHost="myHost"

so why it access to vhost "/" rather than vhost "myHost"