case 6: Boolean dynamic = (Boolean) l.get(4); o.setDynamic(dynamic == null ? false : dynamic); case 7: UnsignedInteger timeout = (UnsignedInteger) l.get(3);
private void createReceiver(Vertx vertx, String address, CompletableFuture<Void> promise, int retries) { receiver = connection.createReceiver(address); Source source = new Source(); source.setDynamic(true); receiver.setSource(source); receiver.openHandler(h -> { if (h.succeeded()) { context = vertx.getOrCreateContext(); replyTo = receiver.getRemoteSource().getAddress(); promise.complete(null); } else { if (retries > maxRetries) { promise.completeExceptionally(h.cause()); } else { log.info("Error creating receiver, retries = {}", retries); vertx.setTimer(1000, id -> createReceiver(vertx, address, promise, retries + 1)); } } }); receiver.handler(((protonDelivery, message) -> { try { replies.put(message); ProtonHelper.accepted(protonDelivery, true); } catch (Exception e) { ProtonHelper.rejected(protonDelivery, true); } })); receiver.open(); }
case 6: Boolean dynamic = (Boolean) l.get(4); o.setDynamic(dynamic == null ? false : dynamic); case 7: UnsignedInteger timeout = (UnsignedInteger) l.get(3);
source.setDynamic(true);
case 6: Boolean dynamic = (Boolean) l.get(4); o.setDynamic(dynamic == null ? false : dynamic); case 7: UnsignedInteger timeout = (UnsignedInteger) l.get(3);
@Override public ProtonReceiver createReceiver(String address, ProtonLinkOptions receiverOptions) { Receiver receiver = session.receiver(getOrCreateLinkName(receiverOptions)); Symbol[] outcomes = new Symbol[] { Accepted.DESCRIPTOR_SYMBOL, Rejected.DESCRIPTOR_SYMBOL, Released.DESCRIPTOR_SYMBOL, Modified.DESCRIPTOR_SYMBOL }; Source source = new Source(); source.setAddress(address); source.setOutcomes(outcomes); source.setDefaultOutcome(Released.getInstance()); if(receiverOptions.isDynamic()) { source.setDynamic(true); } Target target = new Target(); receiver.setSource(source); receiver.setTarget(target); ProtonReceiverImpl r = new ProtonReceiverImpl(receiver); r.openHandler((result) -> { LOG.trace("Receiver open completed"); }); r.closeHandler((result) -> { if (result.succeeded()) { LOG.trace("Receiver closed"); } else { LOG.warn("Receiver closed with error", result.cause()); } }); // Default to at-least-once r.setQoS(ProtonQoS.AT_LEAST_ONCE); return r; }
case 6: Boolean dynamic = (Boolean) l.get(4); o.setDynamic(dynamic == null ? false : dynamic); case 7: UnsignedInteger timeout = (UnsignedInteger) l.get(3);
protected Source createDynamicSource(boolean topic) { Source source = new Source(); source.setDynamic(true); source.setDurable(TerminusDurability.NONE); source.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH); // Set the dynamic node lifetime-policy Map<Symbol, Object> dynamicNodeProperties = new HashMap<>(); dynamicNodeProperties.put(LIFETIME_POLICY, DeleteOnClose.getInstance()); source.setDynamicNodeProperties(dynamicNodeProperties); // Set the capability to indicate the node type being created if (!topic) { source.setCapabilities(TEMP_QUEUE_CAPABILITY); } else { source.setCapabilities(TEMP_TOPIC_CAPABILITY); } return source; }
source.setAddress(destination.getQualifiedName()); source.setCapabilities(AmqpSupport.getDestinationTypeSymbol(destination)); source.setDynamic(true); source.setDynamicNodeProperties(dynamicNodeProperties);
source.setAddress(destination.getQualifiedName()); source.setCapabilities(AmqpSupport.getDestinationTypeSymbol(destination)); source.setDynamic(true); source.setDynamicNodeProperties(dynamicNodeProperties);