Repository: wso2/micro-integrator
Issue: RabbitMQ Exchage declaration fails when there is already an exchange with extra paramters

**Description:**
$subject

**Affected Product Version:**
MI-1.2.0

**Steps to reproduce:**

1. Configure RabbitMQ AMQP with Micro Integrator.
2. Add the following configurations to deployment.toml file.

```toml
[transport.rabbitmq]
 sender_enable = true
 listener_enable = true

 [[transport.rabbitmq.sender]]
 name = "AMQPConnectionFactory"
 parameter.port = 5673
 parameter.username = "guest"
 parameter.password = "guest"


 [[transport.rabbitmq.listener]]
 name = "AMQPConnectionFactory"
 parameter.hostname = "localhost"
 parameter.port = 5673
 parameter.username = "guest"
 parameter.password = "guest"
 parameter.retry_interval = "10"
parameter.retry_count = 5  
```
4. Create a exchange with an alternate-exchange property.
3. Use the proxy RabbitProxy.xml to publish messages to the queue.
```xml
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="RabbitProxy"
       transports="http https"
       startOnLoad="true">
   <description/>
   <target>
      <inSequence>
         <property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
        <log level="custom" category="INFO">
            <property name="this log is" value="***proxy invoked***"/>
         </log>
         <call>
            <endpoint>
               <address uri="rabbitmq:/?rabbitmq.server.host.name=localhost&amp;rabbitmq.server.user.name=guest&amp;rabbitmq.server.password=guest&amp;rabbitmq.server.port=5672&amp;rabbitmq.queue.name=testQ&amp;rabbitmq.exchange.autodeclare=false&amp;rabbitmq.queue.autodeclare=false&amp;rabbitmq.exchange.name=hasi&amp;rabbitmq.connection.factory=CachedRabbitMQConnectionFactory&amp;rabbitmq.queue.route.key=testK"/>
            </endpoint>
         </call>
         <respond/>
      </inSequence>
   </target>
</proxy>
```



Changed files:
components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/rabbitmq/RabbitMQConsumer.java

diff --git a/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/rabbitmq/RabbitMQConsumer.java b/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/rabbitmq/RabbitMQConsumer.java
index de858dfdf..757f58b0e 100644
--- a/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/rabbitmq/RabbitMQConsumer.java
+++ b/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/rabbitmq/RabbitMQConsumer.java
@@ -95,7 +95,20 @@ public class RabbitMQConsumer implements Consumer {
         // declaring queue, exchange and binding
         queueName = rabbitMQProperties.get(RabbitMQConstants.QUEUE_NAME);
         String exchangeName = rabbitMQProperties.get(RabbitMQConstants.EXCHANGE_NAME);
-        RabbitMQUtils.declareQueuesExchangesAndBindings(channel, queueName, exchangeName, rabbitMQProperties);
+
+        try {
+            RabbitMQUtils.declareQueue(channel, queueName, rabbitMQProperties);
+        } catch (IOException ex) {
+            channel = RabbitMQUtils.checkAndIgnoreInEquivalentParamException(connection, ex,
+                    org.apache.axis2.transport.rabbitmq.RabbitMQConstants.QUEUE, queueName);
+        }
+        try {
+            RabbitMQUtils.declareExchange(channel, exchangeName, rabbitMQProperties);
+        } catch (IOException ex) {
+            channel = RabbitMQUtils.checkAndIgnoreInEquivalentParamException(connection, ex,
+                    org.apache.axis2.transport.rabbitmq.RabbitMQConstants.EXCHANGE, exchangeName);
+        }
+        RabbitMQUtils.bindQueueToExchange(channel, queueName, exchangeName, rabbitMQProperties);
 
         // get max dead-lettered count
         maxDeadLetteredCount =