Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when running sample code #61

Open
agapebondservant opened this issue Nov 16, 2022 · 1 comment
Open

Exception when running sample code #61

agapebondservant opened this issue Nov 16, 2022 · 1 comment

Comments

@agapebondservant
Copy link

New to the Prometheus RsocketProxy Client. When I attempt to run the example code provided on the site, I get an exception as shown below - please advise? (Can provide other details as needed.)

import io.micrometer.prometheus.rsocket.PrometheusRSocketClient;
import io.rsocket.transport.netty.client.TcpClientTransport;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.client.RestTemplate;
public class MLModelRSocketClient {
    private static final Logger LOG = LoggerFactory.getLogger(MLModelRSocketClient.class);

    public static void main(String[] args) {

        try {
            PrometheusMeterRegistry meterRegistry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);

            LOG.info("Building RSocket client...");

            PrometheusRSocketClient client = PrometheusRSocketClient
                    .build(meterRegistry,
                            TcpClientTransport.create("localhost", 7001))
                    .connect();
        } catch (Exception ex) {
            LOG.error("Error occurred...");
            LOG.error(ExceptionUtils.getStackTrace(ex));
        }

    }
}
[INFO] --------------------------------------------------------[--r-e-a-c-t-o-r---t-c-p---n-i-o[2m]
 WARN io.netty.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at t[h[ 1t;a3i4lm IoNfF Ot[em ]p iTpoetlailn et.i mIet:  u s2u.a6l0l9y  sm
eans the last handler in the pipeline did not handle the exception.
io.netty.channel.ChannelPi[p[l1i;n3e4EmxIcNeFpOt[omn]:  Frienaicsthoerd. naett:t y2.0r2e2s-o1u1r-c1e6sT.0D7e:f1a3u:l3t1P-o0o5l:e0d0Co
nnectio[n[r1o;v3i4dmeIrN$FPOo[lme]d C[n1nme-c-t-i-o-n-A-l-l-o-c-a-t-o-r-$-P-o-o-l-e-d-C-o-n-n--e-c-t-i-o-n-I-n-i-t-i-a-l-i-z-e-r-.-h-a-n-d-l-e-r-A-d-d-e-d-(-)- -h-a-s- -t-h-r-o-w-n- -a-nemx
ception; removed.
        at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:624)
        at io.netty.channel.DefaultChannelPipeline.access$100(DefaultChannelPipeline.java:46)
        at io.netty.channel.DefaultChannelPipeline$PendingHandlerAddedTask.execute(DefaultChannelPipeline.java:1463)
        at io.netty.channel.DefaultChannelPipeline.callHandlerAddedForAllHandlers(DefaultChannelPipeline.java:1115)
        at io.netty.channel.DefaultChannelPipeline.invokeHandlerAddedIfNeeded(DefaultChannelPipeline.java:650)
        at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:502)
        at io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:417)
        at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:474)
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
        at (base)
@jonatan-ivanov
Copy link
Member

Could you please try to run the app as java -jar ... instead of maven?
I have a hard time reading this:

t[h[ 1t;a3i4lm IoNfF Ot[em ]p iTpoetlailn et.i mIet:  u s2u.a6l0l9y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants