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 7906649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:04:21+00:00 2026-06-03T11:04:21+00:00

in my second question on netty. We are just starting with it. And we

  • 0

in my second question on netty. We are just starting with it. And we have a design where we need to use HTTP with long polling HTTP Streaming. We are estimating from 5k – 50k connected users with an opened connection. We know tomcat won’t handle, so we look over netty to accomplish the task.

The design should be simple enough, but we can’t use websockets (we would love to use hornetQ on top of netty with websocket/stomp support) but we can’t.

So basically we will have server pushing events (we may even use JS SSE to do that) in the connected clients.

Clients will subscribe to an endpoint based on a url (like a queue on JMS, much much simpler though)

So we will have a process on the server side that generate events and notifies the interested channels (we are using a simple observer pattern for this).

So a channel subscribes to those process and then receive events from them.

My question here today is to see if the design approach we used is the right one considering netty’s architecture.

public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
    service.subscribe(this);
    this.context = ctx;
    ctx.sendUpstream(e);
}

//this method gets called by the service when a server event happens
public void onUpdate(String message) {
  ChannelBuffer buffer = Channels.buffer(message.getBytes().length());
  buffer.writeBytes(message.getBytes());
  ChannelFuture future = Channels.future(this.context.getChannel());
  future.addListener(ChannelFutureListener.CLOSE);
  Channels.write(this.context,future,buffer);
}

Regards

  • 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-06-03T11:04:23+00:00Added an answer on June 3, 2026 at 11:04 am

    Looks ok, but there’s not much there. How are you handling the long poll initiation and the possible subsequent timeout ? (Or perhaps you’re totally good with that….. this is not the spanish inquisition)

    One thing you might consider, depending on the number and popularity of your “URL queues” is to use a ChannelGroup as the container for all channels subscribed to that url queue. That way, you can just write the message to the group. Plus, when the channels close, they will be ejected from the group, so there’s some code simplification there.

    Also, have you considered HTTP Streaming ? Not as good as websockets, but better than long polling, in my view.

    I’m not 110% confident that all the implementations are perfect, but I have put together a test project that demonstrates JSON push using netty for long polling, websockets and http streaming. There is also a javascript client that adapts to the push type that you select.You might find it useful (and I am happy to get any feedback on it….)

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

Sidebar

Related Questions

Second question of the day but hopefully simple, I just need to change the
(second question today - must be a bad day) I have a dataframe with
Referring second answer to question: How to convert from ASCII to Hex and vice
My second question of the day and my last attempt to use R to
In my validation class I have this: $fields['a_1'] = 'First Question'; $fields['a_2'] = 'Second
The second question is: When do I use what of these two?
I have a simple program (it was the second question on CCC 2012 )
For the purposes of this question, I do not have the ability to use
I just have a little question about a query making me crazy. I'm working
My first question is how do they get this scroll bar? http://dl.dropbox.com/u/12337149/scrollbar.png I have

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.