private AMQProducerBrokerExchange getProducerBrokerExchange(ProducerId id) throws IOException { AMQProducerBrokerExchange result = producerExchanges.get(id); if (result == null) { synchronized (producerExchanges) { result = new AMQProducerBrokerExchange(); result.setConnectionContext(context); // todo implement reconnect https://issues.apache.org/jira/browse/ARTEMIS-194 if (context.isReconnect() || (context.isNetworkConnection() && this.acceptorUsed.isAuditNetworkProducers())) { if (protocolManager.getPersistenceAdapter() != null) { result.setLastStoredSequenceId( protocolManager.getPersistenceAdapter().getLastProducerSequenceId(id)); } } SessionState ss = state.getSessionState(id.getParentId()); if (ss != null) { result.setProducerState(ss.getProducerState(id)); ProducerState producerState = ss.getProducerState(id); if (producerState != null && producerState.getInfo() != null) { ProducerInfo info = producerState.getInfo(); result.setMutable(info.getDestination() == null || info.getDestination().isComposite()); } } producerExchanges.put(id, result); } } return result; }