@Override public Source getSource(String address) { Source source = new Source(); source.setAddress(address); return source; }
@Override public Source getSource(String address) { Source source = super.getSource(address); source.setDurable(TerminusDurability.UNSETTLED_STATE); return source; }
protected Source createJmsSource(boolean topic) { Source source = new Source(); // Set the capability to indicate the node type being created if (!topic) { source.setCapabilities(QUEUE_CAPABILITY); } else { source.setCapabilities(TOPIC_CAPABILITY); } return source; } }
if(remoteSource.getDynamic()) { String dynamicAddress = UUID.randomUUID().toString(); remoteSource.setAddress(dynamicAddress); if(!sender.sendQueueFull()) { int msgNum = sent.incrementAndGet(); System.out.println("Sending message " + msgNum + " to client, for address: " + remoteSource.getAddress()); Message m = message("Hello " + msgNum + " from Server!"); sender.send(m, delivery -> {
@Override public String toString() { return "Source{" + "address='" + getAddress() + '\'' + ", durable=" + getDurable() + ", expiryPolicy=" + getExpiryPolicy() + ", timeout=" + getTimeout() + ", dynamic=" + getDynamic() + ", dynamicNodeProperties=" + getDynamicNodeProperties() + ", distributionMode=" + _distributionMode + ", filter=" + _filter + ", defaultOutcome=" + _defaultOutcome + ", outcomes=" + (_outcomes == null ? null : Arrays.asList(_outcomes)) + ", capabilities=" + (getCapabilities() == null ? null : Arrays.asList(getCapabilities())) + '}'; }
Map.Entry<Symbol, DescribedType> filter = AmqpSupport.findFilter(source.getFilter(), AmqpSupport.JMS_SELECTOR_FILTER_IDS); if (filter != null) { selector = filter.getValue().getDescribed().toString(); source = new org.apache.qpid.proton.amqp.messaging.Source(); source.setAddress(queue.toString()); source.setDurable(TerminusDurability.UNSETTLED_STATE); source.setExpiryPolicy(TerminusExpiryPolicy.NEVER); source.setDistributionMode(COPY); source.setCapabilities(TOPIC); } else if (source.getDynamic()) { source.setAddress(queue.toString()); } else { SimpleString addressToUse; if (CompositeAddress.isFullyQualified(source.getAddress())) { addressToUse = SimpleString.toSimpleString(CompositeAddress.extractAddressName(source.getAddress())); queueNameToUse = SimpleString.toSimpleString(CompositeAddress.extractQueueName(source.getAddress())); } else { addressToUse = new SimpleString(source.getAddress()); Map.Entry<Symbol, DescribedType> filter = AmqpSupport.findFilter(source.getFilter(), AmqpSupport.NO_LOCAL_FILTER_IDS); if (filter != null) { String remoteContainerId = sender.getSession().getConnection().getRemoteContainer(); String noLocalFilter = MessageUtil.CONNECTION_ID_PROPERTY_NAME.toString() + "<>'" + remoteContainerId + "'"; if (selector != null) {
while(true) { if (link == null) { linkSender = sr.connection.session.sender(sr.topic); Source source = new Source(); Target target = new Target(); source.setAddress(sr.topic); target.setAddress(sr.topic); linkSender.setSource(source); linkSender.setTarget(target); linkSender.open(); linkOpened = true; break; sr.getSender().tell(new SubscribeResponse(engineConnection, sr.topic, exception), this); } else { Receiver linkReceiver = sr.connection.session.receiver(sr.topic.getTopic()); engineConnection.subscriptionData.put(sr.topic.toString(), new EngineConnection.SubscriptionData(sr.getSender(), sr.initialCredit, linkReceiver)); Source source = new Source(); source.setAddress(sr.topic.getTopic()); Target target = new Target(); target.setAddress(sr.topic.getTopic()); source.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH); source.setTimeout(UnsignedInteger.valueOf(sr.ttl)); target.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH); target.setTimeout(UnsignedInteger.valueOf(sr.ttl)); source.setCapabilities(Symbol.valueOf("shared"));
Map.Entry<Symbol, DescribedType> filter = findFilter(source.getFilter(), JMS_SELECTOR_FILTER_IDS); if (filter != null) { selector = filter.getValue().getDescribed().toString(); filter = findFilter(source.getFilter(), NO_LOCAL_FILTER_IDS); if (filter != null) { noLocal = true; source = new org.apache.qpid.proton.amqp.messaging.Source(); source.setAddress(destination.getQualifiedName()); source.setDurable(TerminusDurability.UNSETTLED_STATE); source.setExpiryPolicy(TerminusExpiryPolicy.NEVER); source.setDistributionMode(COPY); } else if (source.getDynamic()) { destination = connection.createTemporaryDestination(protonSender, source.getCapabilities()); source = new org.apache.qpid.proton.amqp.messaging.Source(); source.setAddress(destination.getQualifiedName()); source.setCapabilities(AmqpSupport.getDestinationTypeSymbol(destination)); source.setDynamic(true); source.setDynamicNodeProperties(dynamicNodeProperties); source.setFilter(supportedFilters.isEmpty() ? null : supportedFilters); if (source.getDistributionMode() == COPY && destination.isQueue()) { consumerInfo.setBrowser(true); if ((TerminusDurability.UNSETTLED_STATE.equals(source.getDurable()) ||
Source o = new Source(); o.setCapabilities( (Symbol[]) val0 ); o.setCapabilities( (Symbol) val0 ); o.setOutcomes( (Symbol[]) val1 ); o.setOutcomes( (Symbol) val1 ); o.setDefaultOutcome( (Outcome) l.get( 8 ) ); case 3: o.setFilter( (Map) l.get( 7 ) ); case 4: o.setDistributionMode( (Symbol) l.get( 6 ) ); case 5: o.setDynamicNodeProperties( (Map) l.get( 5 ) ); case 6: Boolean dynamic = (Boolean) l.get(4); o.setDynamic(dynamic == null ? false : dynamic); case 7: UnsignedInteger timeout = (UnsignedInteger) l.get(3); o.setTimeout(timeout == null ? UnsignedInteger.ZERO : timeout); case 8: Symbol expiryPolicy = (Symbol) l.get(2); o.setExpiryPolicy(expiryPolicy == null ? TerminusExpiryPolicy.SESSION_END : TerminusExpiryPolicy.valueOf(expiryPolicy)); case 9: UnsignedInteger durable = (UnsignedInteger) l.get(1); o.setDurable(durable == null ? TerminusDurability.NONE : TerminusDurability.get(durable));
public Receiver create(Session session) { Receiver receiver = session.receiver(_path); Source source = new Source(); source.setAddress(_path); receiver.setSource(source); // the C implemenation does this: Target target = new Target(); target.setAddress(_path); receiver.setTarget(target); if (getIncomingWindow() > 0) { // use explicit settlement via dispositions (not pre-settled) receiver.setSenderSettleMode(SenderSettleMode.UNSETTLED); // desired receiver.setReceiverSettleMode(ReceiverSettleMode.SECOND); } return receiver; } }
public Sender create(Session session) { Sender sender = session.sender(_path); Target target = new Target(); target.setAddress(_path); sender.setTarget(target); // the C implemenation does this: Source source = new Source(); source.setAddress(_path); sender.setSource(source); if (getOutgoingWindow() > 0) { // use explicit settlement via dispositions (not pre-settled) sender.setSenderSettleMode(SenderSettleMode.UNSETTLED); sender.setReceiverSettleMode(ReceiverSettleMode.SECOND); // desired } return sender; } }
public int size() { return _impl.getCapabilities() != null ? 11 : _impl.getOutcomes() != null ? 10 : _impl.getDefaultOutcome() != null ? 9 : _impl.getFilter() != null ? 8 : _impl.getDistributionMode() != null ? 7 : _impl.getDynamicNodeProperties() != null ? 6 : _impl.getDynamic() ? 5 : (_impl.getTimeout() != null && !_impl.getTimeout().equals(UnsignedInteger.ZERO)) ? 4 : _impl.getExpiryPolicy() != TerminusExpiryPolicy.SESSION_END ? 3 : _impl.getDurable() != TerminusDurability.NONE ? 2 : _impl.getAddress() != null ? 1 : 0; }
Source source = new Source(); source.setAddress(senderId); source.setOutcomes(outcomes); Sender sender = session.getEndpoint().sender(senderName); sender.setSource(source); sender.setTarget(target); sender.setSenderSettleMode(userSpecifiedSenderSettlementMode); if (SenderSettleMode.SETTLED.equals(userSpecifiedSenderSettlementMode)) { presettle = true;
session.setOutgoingWindow(Integer.MAX_VALUE); session.open(); BaseHandler.setHandler(session, new SessionHandler(this.linkPath)); sendLinkNamePrefix; Sender sender = session.sender(sendLinkName); Target sednerTarget = new Target(); sednerTarget.setAddress(this.linkPath); sender.setTarget(sednerTarget); Source senderSource = new Source(); senderSource.setAddress(this.replyTo); sender.setSource(senderSource); sender.setSenderSettleMode(SenderSettleMode.SETTLED); sender.setProperties(commonLinkProperties); SendLinkHandler sendLinkHandler = new SendLinkHandler(this.amqpSender); receiveLinkNamePrefix; Receiver receiver = session.receiver(receiveLinkName); Source receiverSource = new Source(); receiverSource.setAddress(this.linkPath); receiver.setSource(receiverSource); Target receiverTarget = new Target(); receiverTarget.setAddress(this.replyTo); receiver.setTarget(receiverTarget);
Map.Entry<Symbol, DescribedType> filter = findFilter(source.getFilter(), JMS_SELECTOR_FILTER_IDS); if (filter != null) { selector = filter.getValue().getDescribed().toString(); source = new org.apache.qpid.proton.amqp.messaging.Source(); source.setAddress(queue); source.setDurable(TerminusDurability.UNSETTLED_STATE); source.setExpiryPolicy(TerminusExpiryPolicy.NEVER); source.setDistributionMode(COPY); source.setCapabilities(TOPIC); sender.setSource(source); if (source.getDynamic()) { source.setAddress(queue); if (TerminusDurability.UNSETTLED_STATE.equals(source.getDurable()) || TerminusDurability.CONFIGURATION.equals(source.getDurable())) { boolean exists = sessionSPI.queueQuery(queue); if (!exists) { sessionSPI.createDurableQueue(source.getAddress(), queue); queue = java.util.UUID.randomUUID().toString(); try { sessionSPI.createTemporaryQueue(source.getAddress(), queue); source.setAddress(queue);
private Source createSharedSource(TerminusDurability terminusDurability) { Source source = new Source(); source.setAddress(address.toString()); source.setCapabilities(TOPIC_CAPABILITY, SHARED); source.setDurable(terminusDurability); return source; }
this.senderLink = session.sender(this.getSenderLinkTag()); this.senderLink.setProperties(this.getAmqpProperties()); Source source = new Source(); target.setAddress(this.getSenderLinkAddress()); source.setAddress(this.getReceiverLinkAddress()); this.senderLink.setTarget(target); this.senderLink.setSource(source); this.receiverLink = session.receiver(this.getReceiverLinkTag()); this.receiverLink.setProperties(this.getAmqpProperties()); Source source = new Source(); target.setAddress(this.getSenderLinkAddress()); source.setAddress(this.getReceiverLinkAddress()); this.receiverLink.setTarget(target); this.receiverLink.setSource(source);
public RequestResponseChannel( final String linkName, final String path, final Session session) { this.replyTo = path.replace("$", "") + "-client-reply-to"; this.openRefCount = new AtomicInteger(2); this.closeRefCount = new AtomicInteger(2); this.inflightRequests = new HashMap<>(); this.requestId = new AtomicLong(0); this.sendLink = session.sender(linkName + ":sender"); final Target target = new Target(); target.setAddress(path); this.sendLink.setTarget(target); sendLink.setSource(new Source()); this.sendLink.setSenderSettleMode(SenderSettleMode.SETTLED); BaseHandler.setHandler(this.sendLink, new SendLinkHandler(new RequestHandler())); this.receiveLink = session.receiver(linkName + ":receiver"); final Source source = new Source(); source.setAddress(path); this.receiveLink.setSource(source); final Target receiverTarget = new Target(); receiverTarget.setAddress(this.replyTo); this.receiveLink.setTarget(receiverTarget); this.receiveLink.setSenderSettleMode(SenderSettleMode.SETTLED); this.receiveLink.setReceiverSettleMode(ReceiverSettleMode.SECOND); BaseHandler.setHandler(this.receiveLink, new ReceiveLinkHandler(new ResponseHandler())); }
session.setIncomingCapacity(Integer.MAX_VALUE); session.open(); BaseHandler.setHandler(session, new SessionHandler(this.receivePath)); receiveLinkNamePrefix.concat(TrackingUtil.TRACKING_ID_TOKEN_SEPARATOR).concat(connection.getRemoteContainer()) : receiveLinkNamePrefix; final Receiver receiver = session.receiver(receiveLinkName); Source source = new Source(); source.setAddress(receivePath); Map<Symbol, Object> linkProperties = new HashMap<>(); source.setFilter(filterMap); receiver.setSource(source); receiver.setTarget(new Target()); receiver.setSenderSettleMode(this.settleModePair.getSenderSettleMode()); receiver.setReceiverSettleMode(this.settleModePair.getReceiverSettleMode());
session.close(); return; final Source source = new Source(); source.setAddress(receivePath); source.setFilter(filterMap); final Receiver receiver = session.receiver(TrackingUtil.getLinkName(session)); receiver.setSource(source); receiver.setTarget(target); receiver.setSenderSettleMode(SenderSettleMode.UNSETTLED); receiver.setReceiverSettleMode(ReceiverSettleMode.SECOND);