GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - opentracing-contrib/java-hprose: OpenTracing instrumentation for the Hprose Remote Object Service Engine

BranchesTags
Open more actions menu

Latest commit

 

History

31 Commits
31 Commits

Folders and files

NameName
Last commit message
Last commit date
.mvn/wrapper
.mvn/wrapper
 
 
src/main/java/io/opentracing/contrib/hprose
src/main/java/io/opentracing/contrib/hprose
 
 
travis
travis
 
 
.gitignore
.gitignore
 
 
.settings.xml
.settings.xml
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
mvnw
mvnw
 
 
mvnw.cmd
mvnw.cmd
 
 
pom.xml
pom.xml
 
 

Repository files navigation

java-hprose

OpenTracing instrumentation for the Hprose Remote Object Service Engine

Build Status Maven Central

Quick start

This repo support the opentracing in hprose-java, if hprose-java use http or https as network protocol.

Server side

Using config

  • If you use hprose servlet to open hprose services. Add init-param on the hprose servlet.
<init-param>
    <param-name>invoke</param-name>
    <param-value>io.opentracing.contrib.hprose.HttpServiceTracingInvokeHandler</param-value>
</init-param>

If you use other InvokeHandlers, except HttpServiceTracingInvokeHandler, you should use comma(,) between these InvokeHandlers.

Using code

package hprose.exam.server;
import hprose.common.HproseMethods;
import hprose.server.HproseServlet;
import io.opentracing.contrib.hprose.HttpServiceTracingInvokeHandler;

public class MyHproseServlet extends HproseServlet {
    public String hello(String name) {
        return "Hello " + name;
    }
    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        service.use(new HttpServiceTracingInvokeHandler());
        service.add("hello", this);
    }
}
  • By default, HttpServiceTracingInvokeHandler use java ServiceLoader to locate OpenTracing tracer implementation. The implementation must be unique, if more than one implemetations are found, HttpServiceTracingInvokeHandler don't use any of them, but swtich to NoopTracer.
  • if you want to use the particular tracer implementation, you can use HttpServiceTracingInvokeHandler'constructor to set the tracer instance. like this:
service.use(new HttpServiceTracingInvokeHandler(tracer));

Client side

  • Use hprose_for_java_x edition, choose HttpClientTracingExInvokeHandler.
client.use(new HttpClientTracingExInvokeHandler(tracer));
  • Use pure client edition, hprose_client_for_java_x edition, choose HttpClientTracingInvokeHandler.
client.use(new HttpClientTracingInvokeHandler(tracer));
  • Also, like server side, you can use java ServiceLoader to locate OpenTracing tracer implementation, or use HttpClientTracingExInvokeHandler or HttpClientTracingInvokeHandler constructor to set the tracer instance.

About

OpenTracing instrumentation for the Hprose Remote Object Service Engine

Topics

hprosejava-hprosetracer

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

4 stars

Watchers

2 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.