Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6979969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:57:13+00:00 2026-05-27T17:57:13+00:00

I created an application that has ~50 users. I am trying to use channel

  • 0

I created an application that has ~50 users.
I am trying to use channel API but I’ve run into a problem while testing with message send.
I am saving the token into the database so i can use the same token if an user opens multiple tabs with the same interface and i have a servlet that resets my token when it expires.

It works fine until I redeploy my application or change the version of my app. I stop receiving messages. If I try to open a channel with the old app version token it doesn’t throw an error or anything, it opens it but I still don’t receive messages on that channel.
If I reset my token it works OK again.

Does anyone know of a solution to this bug, or has anyone had it before? I deploy often while people are working so I can’t ignore it.

My best guess is that ChannelServiceFactory.getChannelService() returns a different instance of ChannelService so when I call channelService.sendMessage("id","message"); it sends it to a different channel.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:57:14+00:00Added an answer on May 27, 2026 at 5:57 pm

    I can’t explain why stored tokens wouldn’t work on re-deploying your app (they should), but I can explain why they don’t work when you change versions. Briefly, tokens are specific to an app version.

    First, the reason for this: we want to ensure that applications that send different data or change message formats or whatever in different versions don’t send messages across version boundaries. In the same way that you don’t want your javascript bundle from v1 rendering against servlets on v2, you wouldn’t want v1 your javascript message handlers receiving messages from v2 servlets (or vice versa).

    So, to hopefully make it clear what’s going on:

    A channel is identified by a combination of your appid, your app version, and the clientid that you provide when you call createChannel or sendMessage. The implementation of the Channel API doesn’t store any mapping of appid/clientid -> token. To greatly simplify, you can think of createChannel as doing something like this:

    public String createChannel(clientid) {
      // obviously we don't really just append strings to each other for actual implementation.
      return encryptStringSomehow(clientid + globalAppInfo.version + globalAppInfo.appid);
    }
    

    and sendMessage is like this:

    public void sendMessage(clientid, message) {
      // identify the JID used for this channel.
      JID xmppJid = new JID(mutateString(clientid + globalAppInfo.version + globalAppInfo.appid),
                            CHANNEL_XMPP_DOMAIN); // some domain used for channel messages
      // send the <message> stanza to that jid with the application message as the body
      xmppService.sendMessage(xmppJid, encodeSomehow(message));
    }
    

    and on the client side, the servlet responsible for the channel decrypts the token and binds to the endpoint identified by a JID created by the same method as the sendMessage function.

    The upshot is that tokens are only valid for messages sent from the same version of the app that created them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an application that has a toolbar, menubar and content area. I
I have an application that has created a number of custom event log sources
Has anyone here created a Flash site or application that is ADA (Section 508)
Our application has many controls that are created dynamically. For example, a navigation pane
I am trying to create a simple Android application that has a ActivityList of
I'm trying to create an application that can use the android as a fax
I've been trying to use Java's ProcessBuilder to launch an application in Linux that
I'm trying to fix a problem with an application that sends a message to
I created an application that parses content of secured areas of one webpage after
I have created an application that writes some data to the root folder of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.