Java Vertx Eventbus Bridge with Angular on client side

9 views
Skip to first unread message

Zolf

unread,
Jun 14, 2022, 1:04:24 AMJun 14
to vert.x

I have implemented vertx eventbus bridge on my client side(Angular) and it works to some extend. I mean some time I get the send message from my Java Vertx application on the client side but some times I get this below error. Can someone please help me to debug or tell me why I get this error. I have a feeling for some reason the client is not registering.

ERROR Error: INVALID_STATE_ERR
    at EventBus.registerHandler (vertx-eventbus.js:279:13)
    at SafeSubscriber._next (core.service.ts:83:16)
    at SafeSubscriber.__tryOrUnsub (Subscriber.ts:265:10)
    at SafeSubscriber.next (Subscriber.ts:207:14)
    at Subscriber._next (Subscriber.ts:139:22)
    at Subscriber.next (Subscriber.ts:99:12)
    at FilterSubscriber._next (UnsubscriptionError.ts:101:24)
    at FilterSubscriber.next (Subscriber.ts:99:12)
    at BehaviorSubject._subscribe (BehaviorSubject.ts:27:18)
    at BehaviorSubject._trySubscribe (Observable.ts:238:19)

and the code in the error is point to line 83 in my Angular code i.e. eventBus.registerHandler.

hostJobProgressSession(){
    console.log('Inside hostJobProgressSession!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
    console.log(this.eventBusService.getEventBus());
    this.eventBusService.getEventBus().subscribe(eventBus => {
      eventBus.registerHandler('update.job.onclient', (error, message) => {
        console.log('Inside registerHandler() -- received a message from server !! : ' + JSON.stringify(message.body));
        this.progressValue.next(message.body);

        if(error)
        {
          console.log('ERROR'+error)
           
      });
    })
  }

I will appreciate your help!!

Reply all
Reply to author
Forward
0 new messages