use of com.newrelic.api.agent.MessageProduceParameters in project newrelic-java-agent by newrelic.
the class Util method generateExternalProduceMetrics.
public static MessageProduceParameters generateExternalProduceMetrics(String queueUrl) {
String queueName = UNKOWN;
int index = queueUrl.lastIndexOf('/');
if (index > 0) {
queueName = queueUrl.substring(index + 1);
}
MessageProduceParameters params = MessageProduceParameters.library(LIBRARY).destinationType(DestinationType.NAMED_QUEUE).destinationName(queueName).outboundHeaders(null).build();
return params;
}
use of com.newrelic.api.agent.MessageProduceParameters in project newrelic-java-agent by newrelic.
the class DefaultTracer method reportAsExternal.
@Override
public void reportAsExternal(ExternalParameters externalParameters) {
if (Agent.LOG.isFineEnabled()) {
Agent.LOG.log(Level.FINE, "Setting externalParameters to: " + externalParameters);
}
MetricNames.recordApiSupportabilityMetric(MetricNames.SUPPORTABILITY_API_REPORT_AS_EXTERNAL);
this.externalParameters = externalParameters;
if (this.externalParameters instanceof HttpParameters) {
// URI validity check and logging
HttpParameters httpParameters = (HttpParameters) this.externalParameters;
URI uri = httpParameters.getUri();
if (uri == null || uri.getScheme() == null || uri.getHost() == null || uri.getPort() == -1) {
Agent.LOG.log(Level.FINE, "URI parameter passed to HttpParameters should include a valid scheme, host, and port.");
}
InboundHeaders headers = httpParameters.getInboundResponseHeaders();
if (null != headers) {
readInboundResponseHeaders(headers);
}
} else if (this.externalParameters instanceof MessageProduceParameters) {
catForMessaging(((MessageProduceParameters) this.externalParameters));
} else if (this.externalParameters instanceof MessageConsumeParameters) {
catForMessaging(((MessageConsumeParameters) this.externalParameters));
}
}
Aggregations