public static MessagingAccessPoint getMessagingAccessPoint() { if (accessPointContainer.TryGetValue(config.MTConnnectionString, out MessagingAccessPoint accessPoint)) { return(accessPoint); } else { accessPoint = MessagingAccessPointAdapter.getMessagingAccessPoint(config.MTConnnectionString, new Dictionary <string, string>()); accessPoint.setRetryStrategy(new RabbitMQRetryStrategy() { RetryInterval = config.RetryInterval.GetValueOrDefault(), RetryCount = config.RetryCount.GetValueOrDefault() }); accessPoint.startup(); accessPointContainer.TryAdd(config.MTConnnectionString, accessPoint); return(accessPoint); } }
/** * Returns a {@code MessagingAccessPoint} instance from the specified OMS driver url with some preset attributes, * which will be passed to MessagingAccessPoint's implementation class as a unique constructor parameter. * * There are some standard attributes defined by OMS for this method, the same as {@link * MessagingAccessPoint#attributes()} ()} * * @param url the specified OMS driver url * @return a {@code MessagingAccessPoint} instance * @throws OMSRuntimeException if the factory fails to create a {@code MessagingAccessPoint} due to some driver url * some syntax error or internal error. */ public static IMessagingAccessPoint getMessagingAccessPoint(string url, IKeyValue attributes) { return(MessagingAccessPointAdapter.getMessagingAccessPoint(url, attributes)); }