BindingRecord oldBindingRecord = bindingTuple.entryToObject(key);
AMQShortString queueName = oldBindingRecord.getQueueName();
AMQShortString exchangeName = oldBindingRecord.getExchangeName();
AMQShortString routingKey = oldBindingRecord.getRoutingKey();
FieldTable arguments = oldBindingRecord.getArguments();
if (_logger.isDebugEnabled())
{
_logger.debug(String.format(
"Processing binding for queue %s, exchange %s, routingKey %s arguments %s", queueName,
exchangeName, routingKey, arguments));
}
// if the queue name is in the gathered list then inspect its binding arguments
// only topic exchange should have a JMS selector key in binding
if (potentialDurableSubs.contains(queueName)
&& exchangeName.equals(AMQShortString.valueOf(ExchangeDefaults.TOPIC_EXCHANGE_NAME)))
{
if (arguments == null)
{
arguments = new FieldTable();
}
AMQShortString selectorFilterKey = AMQPFilterTypes.JMS_SELECTOR.getValue();
if (!arguments.containsKey(selectorFilterKey))
{
if (_logger.isDebugEnabled())
{
_logger.info("adding the empty string (i.e. 'no selector') value for " + queueName
+ " and exchange " + exchangeName);
}
arguments.put(selectorFilterKey, "");
}
}
addBindingToDatabase(bindingTuple, targetDatabase, transaction, queueName, exchangeName, routingKey,
arguments);
}