Starts and propagates {@link Span.Kind#PRODUCER} span for each message sent.
340143
@Override
	public Message<?> preSend(Message<?> message, MessageChannel channel) {
		if (emptyMessage(message)) {
			return message;
		}
		Message<?> retrievedMessage = getMessage(message);
		MessageHeaderAccessor headers = mutableHeaderAccessor(retrievedMessage);
		TraceContextOrSamplingFlags extracted = this.extractor.extract(headers);
		Span span = this.threadLocalSpan.next(extracted);
		MessageHeaderPropagation.removeAnyTraceHeaders(headers,
				this.tracing.propagation().keys());
		this.injector.inject(span.context(), headers);
		if (!span.isNoop()) {
			span.kind(Span.Kind.PRODUCER).name("send").start();
			span.remoteServiceName(REMOTE_SERVICE_NAME);
			addTags(message, span, channel);
		}
		if (log.isDebugEnabled()) {
			log.debug("Created a new span in pre send" + span);
		}
		Message<?> outputMessage = outputMessage(message, retrievedMessage, headers);
		if (isDirectChannel(channel)) {
			beforeHandle(outputMessage, channel, null);
		}
		return outputMessage;
	}
917196
private Span startTracing(String spanName) {
        if (!environment.operationTracingEnabled()) {
            return null;
        }
        Scope scope = environment.tracer()
            .buildSpan(spanName)
            .startActive(false);
        Span parent = scope.span();
        scope.close();
        return parent;
    }
293220
public void execute() {
        state = State.Running;
        for (Subscription sub : subscriptions) {
           sub.publish(this, message);
        }
        state = State.Finished;
        // This part is necessary to support the feature of publishing a DeadMessage or FilteredMessage
        // in case that the original message has not made it to any listener.
        // This happens if subscriptions are empty (due to GC of weak listeners or explicit desubscription)
        // or if configured filters do not let a message pass. The flag is set by the dispatchers.
        // META: This seems to be a suboptimal design
        if (!dispatched) {
            if (!isFilteredMessage() && !isDeadMessage()) {
                runtime.getProvider().publish(new FilteredMessage(message));
            } else if (!isDeadMessage()) {
                runtime.getProvider().publish(new DeadMessage(message));
            }

        }
    }
203323
def push(self,message,message_type):
        
            
        super(Producer,self).send(message,message_type)
217915
def emit(self, span_datas):
        

        try:

            # TODO: keep the stream alive.
            # The stream is terminated after iteration completes.
            # To keep it alive, we can enqueue proto spans here
            # and asyncronously read them and send to the agent.
            responses = self.client.Export(
                self.generate_span_requests(span_datas))

            # read response
            for _ in responses:
                pass

        except grpc.RpcError:
            pass
1200519
@Override
    public void sendInternal(NotificationType type, String... messages) throws NotificationException {
        if (producer == null) {
            createProducer();
        }
        sendInternalToProducer(producer, type, messages);
    }
211466
@Validate
    public void start() {
        module = new SimpleModule(MonitorExtension.class.getName());
        module.addSerializer(MonitorExtension.class, new JsonSerializer<MonitorExtension>() {
            @Override
            public void serialize(MonitorExtension monitorExtension, JsonGenerator jsonGenerator,
                                  SerializerProvider serializerProvider) throws IOException {
                jsonGenerator.writeStartObject();
                jsonGenerator.writeStringField("label", monitorExtension.label());
                jsonGenerator.writeStringField("url", monitorExtension.url());
                jsonGenerator.writeStringField("category", monitorExtension.category());
                jsonGenerator.writeEndObject();
            }
        });
        repository.register(module);
    }
319306
public void run()
    {
        // respond to the request that triggered this validation
        if (!initiator.equals(FBUtilities.getBroadcastAddress()))
            logger.info(String.format("[repair #%s] Sending completed merkle tree to %s for %s/%s", desc.sessionId, initiator, desc.keyspace, desc.columnFamily));
        MessagingService.instance().sendOneWay(new ValidationComplete(desc, tree).createMessage(), initiator);
    }
115171
public void publishAllOutstanding() {
    messagesBatchLock.lock();
    OutstandingBatch batchToSend;
    try {
      if (messagesBatch.isEmpty()) {
        return;
      }
      batchToSend = messagesBatch.popOutstandingBatch();
    } finally {
      messagesBatchLock.unlock();
    }
    publishOutstandingBatch(batchToSend);
  }
687871
public void sendMessage(Message message)
    {
        ((DualMessageQueue)this.getMessageQueue()).getMessageStack().sendMessage(message);
        
        ((BaseMessage)message).setProcessedByClient(true);     // Make sure any server doesn't send this back up.

        super.sendMessage(message);
    }
396717
@Override
  public void process() {
    if (client.isDone() || executorService.isTerminated()) {
      throw new IllegalStateException("Client is already stopped");
    }
    Runnable runner = new Runnable() {
      @Override
      public void run() {
        try {
          while (!client.isDone()) {
            String msg = messageQueue.take();
            try {
              parseMessage(msg);
            } catch (Exception e) {
              logger.warn("Exception thrown during parsing msg " + msg, e);
              onException(e);
            }
          }
        } catch (Exception e) {
          onException(e);
        }
      }
    };

    executorService.execute(runner);
  }
1073575
@Override
	public boolean process(Set<? extends TypeElement> elements,
			RoundEnvironment environment) {
		Messager messager = processingEnv.getMessager();
		
		for (TypeElement element : elements) {
			Set<? extends Element> elementsAnnotatedWith = environment.getElementsAnnotatedWith(element);
			
			for (Element elementAnnotatedWith : elementsAnnotatedWith) {
				TypeElement typeElement = (TypeElement) elementAnnotatedWith;
				EntityValidator validator = new EntityValidator(processingEnv.getTypeUtils());
				List<Problem> problems = validator.validate(typeElement);
				
//				for (Problem problem : problems) {
//					System.out.println(problem);
//				}
				
				boolean error = false;
				
				for (Problem problem : problems) {
					if (problem.kind() == Kind.ERROR) {
						error = true;
					}
					
					messager.printMessage(problem.kind(), problem.message(), problem.element());
				}
				
				if (!error) {
					MetamodelSource source = new MetamodelSource(typeElement, processingEnv);
					
					try {
						source.save();
					} catch (Exception e) {
						messager.printMessage(Kind.ERROR, "Metamodel ["
								+ source.toMetamodelName(typeElement.getQualifiedName().toString())
								+ "] cannot be saved due to [" + e + "]",
								typeElement);
						e.printStackTrace();
					}
				}
			}
		}
		
		return true;
	}
127195
public <T extends BasicMessage> RPCConnectionContext sendAndListen(ProducerConnectionContext context,
            BasicMessage basicMessage, BasicMessageListener<T> responseListener) throws JMSException {
        return sendAndListen(context, basicMessage, responseListener, null);
    }
108278
private void startSpan(ActivityRuntimeContext context) {
        Tracing tracing = TraceHelper.getTracing("mdw-activity");
        Tracer tracer = tracing.tracer();
        Span span = tracer.currentSpan();
        if (span == null) {
            // async brave server if b3 requestHeaders populated (subspan)
            Object requestHeaders = context.getValue("requestHeaders");
            if (requestHeaders instanceof Map) {
                Map<?, ?> headers = (Map<?, ?>) requestHeaders;
                if (headers.containsKey("x-b3-traceid")) {
                    TraceContext.Extractor<Map<?, ?>> extractor =
                            tracing.propagation().extractor((map, key) -> {
                                Object val = map.get(key.toLowerCase());
                                return val == null ? null : val.toString();
                            });
                    TraceContextOrSamplingFlags extracted = extractor.extract(headers);
                    span = extracted.context() != null
                            ? tracer.joinSpan(extracted.context())
                            : tracer.nextSpan(extracted);
                    span.name("m" + context.getMasterRequestId()).kind(Span.Kind.SERVER);
                    span = tracer.newChild(span.context()).name("p" + context.getProcessInstanceId());
                }
            }
        }
        if (span == null) {
            // create a new root span for async start
            span = tracer.nextSpan().name("a" + context.getActivityInstanceId());
        }
        span.start().flush(); // async
        Tracer.SpanInScope spanInScope = tracer.withSpanInScope(span);
        context.getRuntimeAttributes().put(Tracer.SpanInScope.class, spanInScope);
    }
493208
@FunctionName("EventHubTriggerJava")
    public void run(
            @EventHubTrigger(name = "message", eventHubName = "trigger", connection = "CIEventHubConnection", consumerGroup = "$Default") String message,
            @EventHubOutput(name = "result", eventHubName = "output", connection = "CIEventHubConnection" ) OutputBinding<String> result,
            final ExecutionContext context
    ) {
        if(message.contains("CIInput")){
            result.setValue("CITest");
        }
    }
750373
@Override
    public void start() {
        ConnectionPoolMBeanManager.getInstance().registerMonitor(config.getName(), this);

        String seeds = config.getSeeds();
        if (seeds != null && !seeds.isEmpty()) {
            setHosts(config.getSeedHosts());
        }

        config.getLatencyScoreStrategy().start(new Listener() {
            @Override
            public void onUpdate() {
                rebuildPartitions();
            }

            @Override
            public void onReset() {
                rebuildPartitions();
            }
        });
    }
474638
def broadcast(self, clients, msg):
        
        json_msg = None

        count = 0

        for c in clients:
            sess = c.session
            if not sess.is_closed:
                if sess.send_expects_json:
                    if json_msg is None:
                        json_msg = proto.json_encode(msg)
                    sess.send_jsonified(json_msg, stats=False)
                else:
                    sess.send_message(msg, stats=False)

                count += 1

        self.stats.packSent(count)