From jason.kania at ymail.com Mon Feb 1 20:41:03 2016 From: jason.kania at ymail.com (Jason Kania) Date: Tue, 2 Feb 2016 01:41:03 +0000 (UTC) Subject: [undertow-dev] Threading model used for handler processing. References: <1521972916.138605.1454377263306.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <1521972916.138605.1454377263306.JavaMail.yahoo@mail.yahoo.com> Hi, I am trying to create what I call a URL mapping handler that maps path and query variables from the http request to java method parameters via annotations. It is a bit like what Spring or JAX-RS does. The intent is to reduce a bunch of the boilerplate associated with validation of incoming requests, but nothing more than that. One of the stumbling blocks I have come upon is threading model used in calling handlers. I am trying to understand if 1) there is only meant to be a single handler shared by multiple threads such that it must handle multithreading2) the handler instances are somehow cloned.3) one handler is being assigned to a single thread at a time. Without me diving into the code to figure this out, can someone please clarify this? To me this would be a good addition to the handler guide. Thanks, Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20160202/45989311/attachment.html From sdouglas at redhat.com Mon Feb 1 22:38:22 2016 From: sdouglas at redhat.com (Stuart Douglas) Date: Mon, 1 Feb 2016 22:38:22 -0500 (EST) Subject: [undertow-dev] Threading model used for handler processing. In-Reply-To: <1521972916.138605.1454377263306.JavaMail.yahoo@mail.yahoo.com> References: <1521972916.138605.1454377263306.JavaMail.yahoo.ref@mail.yahoo.com> <1521972916.138605.1454377263306.JavaMail.yahoo@mail.yahoo.com> Message-ID: <846183336.18727484.1454384302424.JavaMail.zimbra@redhat.com> A single handler is shared by all threads (in much the same way as Servlet's). If a handler has any form of mutable state it needs to be thread safe. Stuart ----- Original Message ----- > From: "Jason Kania" > To: undertow-dev at lists.jboss.org > Sent: Tuesday, 2 February, 2016 12:41:03 PM > Subject: [undertow-dev] Threading model used for handler processing. > > Hi, > > I am trying to create what I call a URL mapping handler that maps path and > query variables from the http request to java method parameters via > annotations. It is a bit like what Spring or JAX-RS does. The intent is to > reduce a bunch of the boilerplate associated with validation of incoming > requests, but nothing more than that. > > One of the stumbling blocks I have come upon is threading model used in > calling handlers. I am trying to understand if > 1) there is only meant to be a single handler shared by multiple threads such > that it must handle multithreading > 2) the handler instances are somehow cloned. > 3) one handler is being assigned to a single thread at a time. > > Without me diving into the code to figure this out, can someone please > clarify this? To me this would be a good addition to the handler guide. > > Thanks, > > Jason > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From Dominik.Guggemos at bosch-si.com Tue Feb 2 04:07:23 2016 From: Dominik.Guggemos at bosch-si.com (Guggemos Dominik (INST/ECS1)) Date: Tue, 2 Feb 2016 09:07:23 +0000 Subject: [undertow-dev] Undertow WebSocket maximum frame size Message-ID: Hi, is it possible to limit the frame size of WebSocket messages sent from Undertow? I didn't find anything related in the configuration or options. Thanks, Dominik -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20160202/b08edcca/attachment.html From sdouglas at redhat.com Tue Feb 2 04:43:41 2016 From: sdouglas at redhat.com (Stuart Douglas) Date: Tue, 2 Feb 2016 04:43:41 -0500 (EST) Subject: [undertow-dev] Undertow WebSocket maximum frame size In-Reply-To: References: Message-ID: <106202223.18765086.1454406221389.JavaMail.zimbra@redhat.com> They the maximum size is determined by the buffer size (although this refers to individual frames, you can still send larger messages using continuation frames). Stuart ----- Original Message ----- > From: "Guggemos Dominik (INST/ECS1)" > To: undertow-dev at lists.jboss.org > Sent: Tuesday, 2 February, 2016 8:07:23 PM > Subject: [undertow-dev] Undertow WebSocket maximum frame size > > > > Hi, > > > > is it possible to limit the frame size of WebSocket messages sent from > Undertow? I didn?t find anything related in the configuration or options. > > > > Thanks, > > Dominik > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From erhard.siegl at gepardec.com Tue Feb 2 14:59:33 2016 From: erhard.siegl at gepardec.com (Erhard Siegl) Date: Tue, 2 Feb 2016 20:59:33 +0100 Subject: [undertow-dev] Lightweight Service Bus for Orchestration of Microservices with mod_cluster in Undertow Message-ID: <31D60882-3F33-42B3-8876-94E3265ABB49@gepardec.com> Hi, I packed all buzzwords into the subject and I promise to talk about real issues from now on. This is about issue https://issues.jboss.org/browse/UNDERTOW-626, the background, possible solutions and workarounds. But first I?d like to thank Steward for his quick response to the issue and also to my problem with HotSpot 1.8.0_71. Build problem solved! The Background I live in a country that has 9 states. In the area I work, they share a datacenter. Some applications are organised centrally (one database for all states), some are organised locally (each state has its own database and its own application server). We have a rather big application that is organised locally. Since there are quite a few users and we want to have good availability, each state has at least two JBoss servers (EAP6.4 right now). So we have about 20 servers in production. The problem now is, that they don?t live an isolated life, but sometimes they have to talk to each other. And not only with each other but also with a few other applications, some of them organised locally, some centrally. Usually they communicate synchronously with web services. Usually web services are configured point-to-point. This creates quite some configuration challenge. And I?m not talking about micro services here. To ease the problem, a kind of hub and spoke architecture was introduced. Apache httpd with mod_jk is put in front of some applications. This eases configuration to some degree. But it has its downsides. When you kill the hub, all lights go out. Been there, done that, not fun! Also when you add some servers or applications, you have to configure the central mod_jk. The later problem can be solved with mod_cluster. I love mod_cluster! You don?t have to configure it. Just add servers, deploy or undeploy applications on JBoss, no configuration on the central hub necessary. Architects recommend a bus-architecture to overcome the downsides of a central hub. A service bus should have a decentral organisation similar to a hardware bus. Applications connect to the bus and should be able to exchange messages without further configuration. However, when I looked at products called ?Enterprise Service Bus?, I had difficulties to see the bus, most look like hub and spoke architectures. The Idea But then the Undertow team announced the support for mod_cluster in Undertow, which got me really excited. Now it could be possible to create a service bus to connect WildFly servers. You just configure mod_cluster within WildFly and you send web service requests to your own server (localhost) instead of the real destination (https://developer.jboss.org/thread/249311). Because mod_cluster knows about the location of all other servers with the same multicast-address (the bus-adress), it sends the request to the final destination. A real service bus, almost configuration free and comes out of the box with WildFly. Is it only me or do others think as well that this could be a real burner? The Proof of Concept Yes, it does work! We created a setup with two nodes, which shows that the idea can work: https://github.com/AdrianFarmadin/modcluster-invmhttp-example Unfortunately we ran into a problem, which I was not able to solve properly until now. The Problem The problem is described in https://issues.jboss.org/browse/UNDERTOW-626. When you have local context and modcluster filter, modcluster sends requests first to other servers and creates a loop. The Solutions or Workarounds Excluding certain contexts In UNDERTOW-626 Steward suggests: References: Message-ID: Anyone? On Tue, Jan 19, 2016 at 12:19 PM, Girish Sharma wrote: > Hi all, > > I have been (not so frequently) visiting the github repository to find > that new versions of undertow have been released. But when I visit > undertow.io site, there is no information on what's new in the latest > version. > > Thus, this post. > > Is there any changelog or what's new blog for Undertow 1.2, 1.3, 1.4 > and/or 2.0? > > Regards > > -- > Girish Sharma > B.Tech(H), Civil Engineering, > Indian Institute of Technology, Kharagpur > -- Girish Sharma B.Tech(H), Civil Engineering, Indian Institute of Technology, Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20160206/64e18671/attachment.html From sdouglas at redhat.com Mon Feb 8 01:50:30 2016 From: sdouglas at redhat.com (Stuart Douglas) Date: Mon, 8 Feb 2016 01:50:30 -0500 (EST) Subject: [undertow-dev] Lightweight Service Bus for Orchestration of Microservices with mod_cluster in Undertow In-Reply-To: <31D60882-3F33-42B3-8876-94E3265ABB49@gepardec.com> References: <31D60882-3F33-42B3-8876-94E3265ABB49@gepardec.com> Message-ID: <1784026979.22377405.1454914230853.JavaMail.zimbra@redhat.com> There are two possible fixes for this: 1) Add mod_cluster to the end of the handler chain, at the moment it is not really possible to do this, I would need to add some extra config to the Undertow subsystem to specify that a filter should be applied only if no deployments are matched, but this would be relatively easy. 2) Do the deployment match at the begining of the chain, then run the filters, then dispatch to the deployment. This would allow Wildfly to introduce some kind of 'deployment-target' predicate that returns true if the request is targeting a local deployment. I am thinking I will try and implement 2, as it is more flexible (as you could still combine this new predicate with other predicates, e.g. if you want to route to most local deployments with a few select exclusions). Not sure when I will get time to look at this though, hopefully sometime this month. Stuart ----- Original Message ----- > From: "Erhard Siegl" > To: undertow-dev at lists.jboss.org > Sent: Wednesday, 3 February, 2016 6:59:33 AM > Subject: [undertow-dev] Lightweight Service Bus for Orchestration of Microservices with mod_cluster in Undertow > > Hi, > > I packed all buzzwords into the subject and I promise to talk about real > issues from now on. > > This is about issue https://issues.jboss.org/browse/UNDERTOW-626 , the > background, possible solutions and workarounds. But first I?d like to thank > Steward for his quick response to the issue and also to my problem with > HotSpot 1.8.0_71. Build problem solved! > > The Background > > I live in a country that has 9 states. In the area I work, they share a > datacenter. Some applications are organised centrally (one database for all > states), some are organised locally (each state has its own database and its > own application server). We have a rather big application that is organised > locally. Since there are quite a few users and we want to have good > availability, each state has at least two JBoss servers (EAP6.4 right now). > So we have about 20 servers in production. The problem now is, that they > don?t live an isolated life, but sometimes they have to talk to each other. > And not only with each other but also with a few other applications, some of > them organised locally, some centrally. Usually they communicate > synchronously with web services. Usually web services are configured > point-to-point. This creates quite some configuration challenge. And I?m not > talking about micro services here. > > To ease the problem, a kind of hub and spoke architecture was introduced. > Apache httpd with mod_jk is put in front of some applications. This eases > configuration to some degree. But it has its downsides. When you kill the > hub, all lights go out. Been there, done that, not fun! Also when you add > some servers or applications, you have to configure the central mod_jk. The > later problem can be solved with mod_cluster. I love mod_cluster! You don?t > have to configure it. Just add servers, deploy or undeploy applications on > JBoss, no configuration on the central hub necessary. > > Architects recommend a bus-architecture to overcome the downsides of a > central hub. A service bus should have a decentral organisation similar to a > hardware bus. Applications connect to the bus and should be able to exchange > messages without further configuration. However, when I looked at products > called ?Enterprise Service Bus?, I had difficulties to see the bus, most > look like hub and spoke architectures. > > The Idea > > But then the Undertow team announced the support for mod_cluster in Undertow, > which got me really excited. Now it could be possible to create a service > bus to connect WildFly servers. You just configure mod_cluster within > WildFly and you send web service requests to your own server (localhost) > instead of the real destination ( https://developer.jboss.org/thread/249311 > ). Because mod_cluster knows about the location of all other servers with > the same multicast-address (the bus-adress), it sends the request to the > final destination. A real service bus, almost configuration free and comes > out of the box with WildFly. Is it only me or do others think as well that > this could be a real burner? > > The Proof of Concept > > Yes, it does work! We created a setup with two nodes, which shows that the > idea can work: https://github.com/AdrianFarmadin/modcluster-invmhttp-example > Unfortunately we ran into a problem, which I was not able to solve properly > until now. > > The Problem > > The problem is described in https://issues.jboss.org/browse/UNDERTOW-626 . > When you have local context and modcluster filter, modcluster sends requests > first to other servers and creates a loop. > > The Solutions or Workarounds > > Excluding certain contexts > In UNDERTOW-626 Steward suggests: > difficult. > > In modcluster filter: Don?t handle context, if its from the local server > In https://github.com/undertow-io/undertow/pull/356/files we tried to change > the mod cluster filter such that it doesn?t forward a request if it the > context exists on the local server. > We used this for our proof of concept for which it worked. > The problem is, that is uses conventions from WildFly to answer the question > ?What is my local jvmroute?. The system-property ?jboss.node.name? is the > default in WildFly, but thats not necessarily true otherwise. But we > couldn?t find how to access the configuration property instance-id within > undertow. > > Fix it in WildFly > In https://github.com/undertow-io/undertow/pull/356 Steward pointed out that > the problem should be solved in WildFly. Could you point us in a direction > where we could go? We are willing to invest some time into this issue, but > we don?t have enough inside knowledge from Undertow or WildFly jet. > > Put modcluster at the end of the handler chain > Right now modcluster is invoked before the deployed applications are invoked. > Maybe one could do it the other way round and invoke modcluster only if the > deployed applications return ?not found?? I just don?t know enough about > Undertow to decide whether this is feasible or just a stupid idea. > > Other? > > The End > Any remarks, ideas, and help are welcome. > > Erhard > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From sdouglas at redhat.com Mon Feb 8 04:27:19 2016 From: sdouglas at redhat.com (Stuart Douglas) Date: Mon, 8 Feb 2016 04:27:19 -0500 (EST) Subject: [undertow-dev] Undertow changelog and latest features In-Reply-To: References: Message-ID: <251153726.22392391.1454923639547.JavaMail.zimbra@redhat.com> 1.3.x is the current stable branch, it will be in Wildfly 10 / EAP7. 1.4.x and 2.0.x are development branches, in general they should maintain feature parity, however 2.0 will target Servlet 3.1 and require JDK8. The changelog is tracked by JIRA: https://issues.jboss.org/projects/UNDERTOW To some extent JIRA also serves as the road map, if a feature is planned it should have an issue in JIRA. I recently created an Undertow twitter account to broadcast new releases (https://twitter.com/undertow_io). At the moment the website is not updated as often as it should be, its my fault, at some point in the next few months I will be looking at changing how it is generated. Stuart ----- Original Message ----- > From: "Girish Sharma" > To: undertow-dev at lists.jboss.org > Sent: Sunday, 7 February, 2016 5:00:20 AM > Subject: Re: [undertow-dev] Undertow changelog and latest features > > Anyone? > > On Tue, Jan 19, 2016 at 12:19 PM, Girish Sharma < scrapmachines at gmail.com > > wrote: > > > > Hi all, > > I have been (not so frequently) visiting the github repository to find that > new versions of undertow have been released. But when I visit undertow.io > site, there is no information on what's new in the latest version. > > Thus, this post. > > Is there any changelog or what's new blog for Undertow 1.2, 1.3, 1.4 and/or > 2.0? > > Regards > > -- > Girish Sharma > B.Tech(H), Civil Engineering , > Indian Institute of Technology, Kharagpur > > > > -- > Girish Sharma > B.Tech(H), Civil Engineering , > Indian Institute of Technology, Kharagpur > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From Dominik.Guggemos at bosch-si.com Mon Feb 8 06:55:36 2016 From: Dominik.Guggemos at bosch-si.com (Guggemos Dominik (INST/ECS1)) Date: Mon, 8 Feb 2016 11:55:36 +0000 Subject: [undertow-dev] Undertow WebSocket maximum frame size In-Reply-To: <106202223.18765086.1454406221389.JavaMail.zimbra@redhat.com> References: <106202223.18765086.1454406221389.JavaMail.zimbra@redhat.com> Message-ID: Hi Stuart, that's what I'm trying to do, sending large messages that consist of multiple frames. By buffer size do you mean this option: Undertow.builder().setBufferSize(1024)....? Because this doesn't work for me, the message (larger than 1024 bytes) is always transferred in one frame. Maybe you can provide an example how to do this correctly? Thanks, Dominik -----Urspr?ngliche Nachricht----- Von: Stuart Douglas [mailto:sdouglas at redhat.com] Gesendet: Dienstag, 2. Februar 2016 10:44 An: Guggemos Dominik (INST/ECS1) Cc: undertow-dev at lists.jboss.org Betreff: Re: [undertow-dev] Undertow WebSocket maximum frame size They the maximum size is determined by the buffer size (although this refers to individual frames, you can still send larger messages using continuation frames). Stuart ----- Original Message ----- > From: "Guggemos Dominik (INST/ECS1)" > To: undertow-dev at lists.jboss.org > Sent: Tuesday, 2 February, 2016 8:07:23 PM > Subject: [undertow-dev] Undertow WebSocket maximum frame size > > > > Hi, > > > > is it possible to limit the frame size of WebSocket messages sent from > Undertow? I didn?t find anything related in the configuration or options. > > > > Thanks, > > Dominik > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From sdouglas at redhat.com Mon Feb 8 15:49:54 2016 From: sdouglas at redhat.com (Stuart Douglas) Date: Mon, 8 Feb 2016 15:49:54 -0500 (EST) Subject: [undertow-dev] Undertow WebSocket maximum frame size In-Reply-To: References: <106202223.18765086.1454406221389.JavaMail.zimbra@redhat.com> Message-ID: <417451819.22816188.1454964594187.JavaMail.zimbra@redhat.com> How are you using websockets? If you are using the JSR-356 API and deploying using WebSocketDeploymentInfo you need to change the buffer size for outgoing connections in the setBuffers() call: new WebSocketDeploymentInfo() .setBuffers(new DefaultByteBufferPool(true, 1024)) Otherwise the buffer size from the Undertow builder should be used. Can you provide an example of that you are doing? Stuart ----- Original Message ----- > From: "Guggemos Dominik (INST/ECS1)" > To: "Stuart Douglas" > Cc: undertow-dev at lists.jboss.org > Sent: Monday, 8 February, 2016 10:55:36 PM > Subject: AW: [undertow-dev] Undertow WebSocket maximum frame size > > Hi Stuart, > > that's what I'm trying to do, sending large messages that consist of multiple > frames. > > By buffer size do you mean this option: > > Undertow.builder().setBufferSize(1024)....? > > Because this doesn't work for me, the message (larger than 1024 bytes) is > always transferred in one frame. > Maybe you can provide an example how to do this correctly? > > Thanks, Dominik > > -----Urspr?ngliche Nachricht----- > Von: Stuart Douglas [mailto:sdouglas at redhat.com] > Gesendet: Dienstag, 2. Februar 2016 10:44 > An: Guggemos Dominik (INST/ECS1) > Cc: undertow-dev at lists.jboss.org > Betreff: Re: [undertow-dev] Undertow WebSocket maximum frame size > > They the maximum size is determined by the buffer size (although this refers > to individual frames, you can still send larger messages using continuation > frames). > > Stuart > > ----- Original Message ----- > > From: "Guggemos Dominik (INST/ECS1)" > > To: undertow-dev at lists.jboss.org > > Sent: Tuesday, 2 February, 2016 8:07:23 PM > > Subject: [undertow-dev] Undertow WebSocket maximum frame size > > > > > > > > Hi, > > > > > > > > is it possible to limit the frame size of WebSocket messages sent from > > Undertow? I didn?t find anything related in the configuration or options. > > > > > > > > Thanks, > > > > Dominik > > > > _______________________________________________ > > undertow-dev mailing list > > undertow-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/undertow-dev > From oliver at analyticspot.com Mon Feb 8 18:27:02 2016 From: oliver at analyticspot.com (Oliver Dain) Date: Mon, 08 Feb 2016 23:27:02 +0000 Subject: [undertow-dev] Let undertow pick a port Message-ID: I'm trying to write some unit tests with an embedded undertow server. I?d like to have the server find an open port. This makes the tests more robust in many ways. For example, tests can be run in parallel and if a socket is held in CLOSE_WAIT or something from a previous test the next test will still run and succeed. With most servers I?ve used you can pass 0 for the port and the server will find an open port. This doesn?t seem to be the case with Undertow. Even if that would work, I don't see a method like getPort() on the Undertow object so I don't know how I'd discover the port to which it bound. Is this possible?? Thanks, Oliver -- CTO, Analytic Spot 44 West Broadway #222 Eugene, OR 97401 analyticspot.com ? 425-296-6556 www.linkedin.com/in/oliverdain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20160208/d26f3cf0/attachment-0001.html From sdouglas at redhat.com Tue Feb 9 01:25:31 2016 From: sdouglas at redhat.com (Stuart Douglas) Date: Tue, 9 Feb 2016 01:25:31 -0500 (EST) Subject: [undertow-dev] Let undertow pick a port In-Reply-To: References: Message-ID: <683238123.22894201.1454999131814.JavaMail.zimbra@redhat.com> This is not currently possible in an 'easy' manner. You could do it manually (avoiding the Undertow object and using XNIO + the listeners directly and writing your own code to handle this) however this is probably not what you are after. If you file a JIRA I should be able to get this into the next Undertow version. Stuart ----- Original Message ----- > From: "Oliver Dain" > To: undertow-dev at lists.jboss.org > Sent: Tuesday, 9 February, 2016 10:27:02 AM > Subject: [undertow-dev] Let undertow pick a port > > > > I'm trying to write some unit tests with an embedded undertow server. I?d > like to have the server find an open port. This makes the tests more robust > in many ways. For example, tests can be run in parallel and if a socket is > held in CLOSE_WAIT or something from a previous test the next test will > still run and succeed. With most servers I?ve used you can pass 0 for the > port and the server will find an open port. This doesn?t seem to be the case > with Undertow. Even if that would work, I don't see a method like getPort() > on the Undertow object so I don't know how I'd discover the port to which it > bound. Is this possible?? > > > Thanks, > Oliver > -- > CTO, Analytic Spot > 44 West Broadway #222 > Eugene, OR 97401 > analyticspot.com ? 425-296-6556 > www.linkedin.com/in/oliverdain > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From Dominik.Guggemos at bosch-si.com Tue Feb 9 03:03:52 2016 From: Dominik.Guggemos at bosch-si.com (Guggemos Dominik (INST/ECS1)) Date: Tue, 9 Feb 2016 08:03:52 +0000 Subject: [undertow-dev] Undertow WebSocket maximum frame size In-Reply-To: <417451819.22816188.1454964594187.JavaMail.zimbra@redhat.com> References: <106202223.18765086.1454406221389.JavaMail.zimbra@redhat.com> <417451819.22816188.1454964594187.JavaMail.zimbra@redhat.com> Message-ID: Basically we are using Undertow as shown in the ChatServer example (https://github.com/undertow-io/undertow/blob/master/examples/src/main/java/io/undertow/examples/chat/ChatServer.java) i.e. no JSR-356 API. With the small difference that we are sending binary data and we set a buffer size using the Undertow builder. As Websocket client we are using the AsyncHttpClient (https://github.com/AsyncHttpClient/async-http-client) which then fails receiving messages larger than the set buffer size with an exception saying "Max frame length has been exceeded.". Example code here: https://gist.github.com/dguggemos/3c1c3316052e1dbeb663 Dominik -----Urspr?ngliche Nachricht----- Von: Stuart Douglas [mailto:sdouglas at redhat.com] Gesendet: Montag, 8. Februar 2016 21:50 An: Guggemos Dominik (INST/ECS1) Cc: undertow-dev at lists.jboss.org Betreff: Re: AW: [undertow-dev] Undertow WebSocket maximum frame size How are you using websockets? If you are using the JSR-356 API and deploying using WebSocketDeploymentInfo you need to change the buffer size for outgoing connections in the setBuffers() call: new WebSocketDeploymentInfo() .setBuffers(new DefaultByteBufferPool(true, 1024)) Otherwise the buffer size from the Undertow builder should be used. Can you provide an example of that you are doing? Stuart ----- Original Message ----- > From: "Guggemos Dominik (INST/ECS1)" > To: "Stuart Douglas" > Cc: undertow-dev at lists.jboss.org > Sent: Monday, 8 February, 2016 10:55:36 PM > Subject: AW: [undertow-dev] Undertow WebSocket maximum frame size > > Hi Stuart, > > that's what I'm trying to do, sending large messages that consist of > multiple frames. > > By buffer size do you mean this option: > > Undertow.builder().setBufferSize(1024)....? > > Because this doesn't work for me, the message (larger than 1024 bytes) > is always transferred in one frame. > Maybe you can provide an example how to do this correctly? > > Thanks, Dominik > > -----Urspr?ngliche Nachricht----- > Von: Stuart Douglas [mailto:sdouglas at redhat.com] > Gesendet: Dienstag, 2. Februar 2016 10:44 > An: Guggemos Dominik (INST/ECS1) > Cc: undertow-dev at lists.jboss.org > Betreff: Re: [undertow-dev] Undertow WebSocket maximum frame size > > They the maximum size is determined by the buffer size (although this > refers to individual frames, you can still send larger messages using > continuation frames). > > Stuart > > ----- Original Message ----- > > From: "Guggemos Dominik (INST/ECS1)" > > To: undertow-dev at lists.jboss.org > > Sent: Tuesday, 2 February, 2016 8:07:23 PM > > Subject: [undertow-dev] Undertow WebSocket maximum frame size > > > > > > > > Hi, > > > > > > > > is it possible to limit the frame size of WebSocket messages sent > > from Undertow? I didn?t find anything related in the configuration or options. > > > > > > > > Thanks, > > > > Dominik > > > > _______________________________________________ > > undertow-dev mailing list > > undertow-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/undertow-dev > From sdouglas at redhat.com Tue Feb 9 03:45:29 2016 From: sdouglas at redhat.com (Stuart Douglas) Date: Tue, 9 Feb 2016 03:45:29 -0500 (EST) Subject: [undertow-dev] Undertow WebSocket maximum frame size In-Reply-To: References: <106202223.18765086.1454406221389.JavaMail.zimbra@redhat.com> <417451819.22816188.1454964594187.JavaMail.zimbra@redhat.com> Message-ID: <681796881.22910604.1455007529572.JavaMail.zimbra@redhat.com> Ah, looks like I forgot about a relatively recent optimization that was added. A new method (AbstractFramedStreamSinkChannel.send) was added that allows you to send the whole contents of a buffer in one frame (which prevents double copying into the internal stream buffer). The WebSockets utility methods have been changed to use this method. If you use the write() method instead of send() then it will use the internal buffer which will limit the frame size to the internal buffer size (have a look in io.undertow.util.StringWriteChannelListener for an example of how to use this). Stuart ----- Original Message ----- > From: "Guggemos Dominik (INST/ECS1)" > To: "Stuart Douglas" > Cc: undertow-dev at lists.jboss.org > Sent: Tuesday, 9 February, 2016 7:03:52 PM > Subject: AW: [undertow-dev] Undertow WebSocket maximum frame size > > Basically we are using Undertow as shown in the ChatServer example > (https://github.com/undertow-io/undertow/blob/master/examples/src/main/java/io/undertow/examples/chat/ChatServer.java) > i.e. no JSR-356 API. With the small difference that we are sending binary > data and we set a buffer size using the Undertow builder. As Websocket > client we are using the AsyncHttpClient > (https://github.com/AsyncHttpClient/async-http-client) which then fails > receiving messages larger than the set buffer size with an exception saying > "Max frame length has been exceeded.". Example code here: > https://gist.github.com/dguggemos/3c1c3316052e1dbeb663 > > Dominik > > -----Urspr?ngliche Nachricht----- > Von: Stuart Douglas [mailto:sdouglas at redhat.com] > Gesendet: Montag, 8. Februar 2016 21:50 > An: Guggemos Dominik (INST/ECS1) > Cc: undertow-dev at lists.jboss.org > Betreff: Re: AW: [undertow-dev] Undertow WebSocket maximum frame size > > How are you using websockets? > > If you are using the JSR-356 API and deploying using WebSocketDeploymentInfo > you need to change the buffer size for outgoing connections in the > setBuffers() call: > > new WebSocketDeploymentInfo() > .setBuffers(new DefaultByteBufferPool(true, > 1024)) > > Otherwise the buffer size from the Undertow builder should be used. Can you > provide an example of that you are doing? > > Stuart > > > > ----- Original Message ----- > > From: "Guggemos Dominik (INST/ECS1)" > > To: "Stuart Douglas" > > Cc: undertow-dev at lists.jboss.org > > Sent: Monday, 8 February, 2016 10:55:36 PM > > Subject: AW: [undertow-dev] Undertow WebSocket maximum frame size > > > > Hi Stuart, > > > > that's what I'm trying to do, sending large messages that consist of > > multiple frames. > > > > By buffer size do you mean this option: > > > > Undertow.builder().setBufferSize(1024)....? > > > > Because this doesn't work for me, the message (larger than 1024 bytes) > > is always transferred in one frame. > > Maybe you can provide an example how to do this correctly? > > > > Thanks, Dominik > > > > -----Urspr?ngliche Nachricht----- > > Von: Stuart Douglas [mailto:sdouglas at redhat.com] > > Gesendet: Dienstag, 2. Februar 2016 10:44 > > An: Guggemos Dominik (INST/ECS1) > > Cc: undertow-dev at lists.jboss.org > > Betreff: Re: [undertow-dev] Undertow WebSocket maximum frame size > > > > They the maximum size is determined by the buffer size (although this > > refers to individual frames, you can still send larger messages using > > continuation frames). > > > > Stuart > > > > ----- Original Message ----- > > > From: "Guggemos Dominik (INST/ECS1)" > > > To: undertow-dev at lists.jboss.org > > > Sent: Tuesday, 2 February, 2016 8:07:23 PM > > > Subject: [undertow-dev] Undertow WebSocket maximum frame size > > > > > > > > > > > > Hi, > > > > > > > > > > > > is it possible to limit the frame size of WebSocket messages sent > > > from Undertow? I didn?t find anything related in the configuration or > > > options. > > > > > > > > > > > > Thanks, > > > > > > Dominik > > > > > > _______________________________________________ > > > undertow-dev mailing list > > > undertow-dev at lists.jboss.org > > > https://lists.jboss.org/mailman/listinfo/undertow-dev > > > From oliver at analyticspot.com Tue Feb 9 13:19:57 2016 From: oliver at analyticspot.com (Oliver Dain) Date: Tue, 09 Feb 2016 18:19:57 +0000 Subject: [undertow-dev] Let undertow pick a port In-Reply-To: <683238123.22894201.1454999131814.JavaMail.zimbra@redhat.com> References: <683238123.22894201.1454999131814.JavaMail.zimbra@redhat.com> Message-ID: Hey Stuart, Thanks for getting back to me. Filed a bug here: https://issues.jboss.org/browse/UNDERTOW-628 Any approximate ETA on the next version? Thanks, Oliver On Mon, Feb 8, 2016 at 10:25 PM Stuart Douglas wrote: > This is not currently possible in an 'easy' manner. You could do it > manually (avoiding the Undertow object and using XNIO + the listeners > directly and writing your own code to handle this) however this is probably > not what you are after. If you file a JIRA I should be able to get this > into the next Undertow version. > > Stuart > > ----- Original Message ----- > > From: "Oliver Dain" > > To: undertow-dev at lists.jboss.org > > Sent: Tuesday, 9 February, 2016 10:27:02 AM > > Subject: [undertow-dev] Let undertow pick a port > > > > > > > > I'm trying to write some unit tests with an embedded undertow server. I?d > > like to have the server find an open port. This makes the tests more > robust > > in many ways. For example, tests can be run in parallel and if a socket > is > > held in CLOSE_WAIT or something from a previous test the next test will > > still run and succeed. With most servers I?ve used you can pass 0 for the > > port and the server will find an open port. This doesn?t seem to be the > case > > with Undertow. Even if that would work, I don't see a method like > getPort() > > on the Undertow object so I don't know how I'd discover the port to > which it > > bound. Is this possible?? > > > > > > Thanks, > > Oliver > > -- > > CTO, Analytic Spot > > 44 West Broadway #222 > > Eugene, OR 97401 > > analyticspot.com ? 425-296-6556 > > www.linkedin.com/in/oliverdain > > > > _______________________________________________ > > undertow-dev mailing list > > undertow-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/undertow-dev > -- CTO, Analytic Spot 44 West Broadway #222 Eugene, OR 97401 analyticspot.com ? 425-296-6556 www.linkedin.com/in/oliverdain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20160209/7692714f/attachment.html From michael.hixson at gmail.com Wed Feb 10 03:44:44 2016 From: michael.hixson at gmail.com (Michael Hixson) Date: Wed, 10 Feb 2016 00:44:44 -0800 Subject: [undertow-dev] Undertow changelog and latest features In-Reply-To: <251153726.22392391.1454923639547.JavaMail.zimbra@redhat.com> References: <251153726.22392391.1454923639547.JavaMail.zimbra@redhat.com> Message-ID: Thanks, I was also wondering about this. Here's a direct link to the releases page, for anyone else like me who knew about Jira but still had trouble finding changelogs: https://issues.jboss.org/projects/UNDERTOW?selectedItem=com.atlassian.jira.jira-projects-plugin:release-page&status=released I have a related question. Stuart, how should users react to micro-level releases? Upgrade ASAP? -Michael On Mon, Feb 8, 2016 at 1:27 AM, Stuart Douglas wrote: > > 1.3.x is the current stable branch, it will be in Wildfly 10 / EAP7. > 1.4.x and 2.0.x are development branches, in general they should maintain feature parity, however 2.0 will target Servlet 3.1 and require JDK8. > > The changelog is tracked by JIRA: https://issues.jboss.org/projects/UNDERTOW > > To some extent JIRA also serves as the road map, if a feature is planned it should have an issue in JIRA. > > I recently created an Undertow twitter account to broadcast new releases (https://twitter.com/undertow_io). > > At the moment the website is not updated as often as it should be, its my fault, at some point in the next few months I will be looking at changing how it is generated. > > Stuart > > > > ----- Original Message ----- >> From: "Girish Sharma" >> To: undertow-dev at lists.jboss.org >> Sent: Sunday, 7 February, 2016 5:00:20 AM >> Subject: Re: [undertow-dev] Undertow changelog and latest features >> >> Anyone? >> >> On Tue, Jan 19, 2016 at 12:19 PM, Girish Sharma < scrapmachines at gmail.com > >> wrote: >> >> >> >> Hi all, >> >> I have been (not so frequently) visiting the github repository to find that >> new versions of undertow have been released. But when I visit undertow.io >> site, there is no information on what's new in the latest version. >> >> Thus, this post. >> >> Is there any changelog or what's new blog for Undertow 1.2, 1.3, 1.4 and/or >> 2.0? >> >> Regards >> >> -- >> Girish Sharma >> B.Tech(H), Civil Engineering , >> Indian Institute of Technology, Kharagpur >> >> >> >> -- >> Girish Sharma >> B.Tech(H), Civil Engineering , >> Indian Institute of Technology, Kharagpur >> >> _______________________________________________ >> undertow-dev mailing list >> undertow-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/undertow-dev > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From f.van.vollenhoven at gmail.com Thu Feb 11 07:12:11 2016 From: f.van.vollenhoven at gmail.com (Friso van Vollenhoven) Date: Thu, 11 Feb 2016 13:12:11 +0100 Subject: [undertow-dev] Read request body in HttpHandler Message-ID: Hi all, I'm not sure if this is the right channel to go for help, but there seems to be no separate user list, so I'll take a shot here. I need to create a HttpHandler that fully reads the request body and stores it into a buffer or byte[] before ending the exchange. For this, I'm trying to digest what Undertow's RequestBufferingHandler does. It seems that I have to take care of the scenario where the handler is called before the entire request body is available on the stream by doing the following: - read from the stream - check whether I've hit the end of the stream when as many bytes as possible have been read - if not, register a listener on the stream and continue handling the request from there - if so, handle the request from the handler directly - finally close the stream Can someone assert that the above is correct? Also, are there general pointers to what I'd like to achieve (read the request body into a buffer)? Many thanks, cheers, Friso -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20160211/4460c56c/attachment.html From sdouglas at redhat.com Thu Feb 11 14:51:53 2016 From: sdouglas at redhat.com (Stuart Douglas) Date: Thu, 11 Feb 2016 14:51:53 -0500 (EST) Subject: [undertow-dev] Read request body in HttpHandler In-Reply-To: References: Message-ID: <434606653.25186296.1455220313585.JavaMail.zimbra@redhat.com> RequestBufferingHandler is a performance enhancing handler that is designed to be used for blocking requests, basically it allows you to fully read the request before the request gets dispatched to a (potentially limited) thread pool. If you want to read the full body in a non blocking manner the easiest way is to just use the following, it will read the full request into a buffer and then invoke the provided callback: HttpServerExchange.getRequestReceiver().receiveFullBytes((exchange, data) -> { //do stuff with the data }, (exchange, exception) -> { //optional error handler } ) Stuart ----- Original Message ----- > From: "Friso van Vollenhoven" > To: undertow-dev at lists.jboss.org > Sent: Thursday, 11 February, 2016 11:12:11 PM > Subject: [undertow-dev] Read request body in HttpHandler > > Hi all, > > I'm not sure if this is the right channel to go for help, but there seems to > be no separate user list, so I'll take a shot here. > > I need to create a HttpHandler that fully reads the request body and stores > it into a buffer or byte[] before ending the exchange. For this, I'm trying > to digest what Undertow's RequestBufferingHandler does. > > It seems that I have to take care of the scenario where the handler is called > before the entire request body is available on the stream by doing the > following: > - read from the stream > - check whether I've hit the end of the stream when as many bytes as possible > have been read > - if not, register a listener on the stream and continue handling the request > from there > - if so, handle the request from the handler directly > - finally close the stream > > Can someone assert that the above is correct? > > Also, are there general pointers to what I'd like to achieve (read the > request body into a buffer)? > > > Many thanks, cheers, > Friso > > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From aliok at apache.org Tue Feb 16 07:07:55 2016 From: aliok at apache.org (Ali Ok) Date: Tue, 16 Feb 2016 13:07:55 +0100 Subject: [undertow-dev] Undertow Websockets production tweak Message-ID: Hi all, I will soon go live with a project of mine which uses Undertow. I was wondering if you could give me some advice on tweaking Undertow for the production use. The only things I found are: * http://undertow.io/undertow-docs/undertow-docs-1.3.0/index.html#common-listener-options * http://lists.jboss.org/pipermail/undertow-dev/2015-March/001169.html Number of configurable things on the documentation and also when I was reading the code drove me crazy :) My use case is: * Undertow only used as a websocket endpoint of an MMO game; no servlet or something * Binary data only (Protobufs, specifically) * 300-400 concurrent connections per server * High frequency of transfer, again per server (23 KB/s transfer out per connection; 1 KB/s transfer in per connection) * Limited server specs (1 core CPU, 1GB RAM) I know I cannot of course ask you the exact configuration. What I am looking for is some help at pointing at the right direction. Thanks, Ali -- My Blog: http://blog.aliok.com.tr Twitter: http://twitter.com/aliok_tr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20160216/a7acc643/attachment.html From sdouglas at redhat.com Tue Feb 16 07:35:26 2016 From: sdouglas at redhat.com (Stuart Douglas) Date: Tue, 16 Feb 2016 07:35:26 -0500 (EST) Subject: [undertow-dev] Undertow Websockets production tweak In-Reply-To: References: Message-ID: <601722919.26440688.1455626126081.JavaMail.zimbra@redhat.com> If you are using the Undertow builder API it will adapt to your systems specs. In your case the default config should be fine I think. One thing you may want to look at is the buffer size, which controls the size of web socket frames. Stuart ----- Original Message ----- > From: "Ali Ok" > To: undertow-dev at lists.jboss.org > Sent: Tuesday, 16 February, 2016 11:07:55 PM > Subject: [undertow-dev] Undertow Websockets production tweak > > Hi all, > > I will soon go live with a project of mine which uses Undertow. > I was wondering if you could give me some advice on tweaking Undertow for the > production use. > > The only things I found are: > > * > http://undertow.io/undertow-docs/undertow-docs-1.3.0/index.html#common-listener-options > * http://lists.jboss.org/pipermail/undertow-dev/2015-March/001169.html > > Number of configurable things on the documentation and also when I was > reading the code drove me crazy :) > > My use case is: > > * Undertow only used as a websocket endpoint of an MMO game; no servlet or > something > * Binary data only (Protobufs, specifically) > * 300-400 concurrent connections per server > * High frequency of transfer, again per server (23 KB/s transfer out per > connection; 1 KB/s transfer in per connection) > * Limited server specs (1 core CPU, 1GB RAM) > > I know I cannot of course ask you the exact configuration. What I am looking > for is some help at pointing at the right direction. > > Thanks, > Ali > > > > -- > My Blog: http://blog.aliok.com.tr > Twitter: http://twitter.com/aliok_tr > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From Vikas.Nagaraj at safenet-inc.com Wed Feb 17 14:10:49 2016 From: Vikas.Nagaraj at safenet-inc.com (Nagaraj,Vikas) Date: Wed, 17 Feb 2016 14:10:49 -0500 Subject: [undertow-dev] How to get response bytes before they are sent Message-ID: Hello, Is it possible to get the full content of a response body before it's sent? I'm trying to sign the response and add this signature in a header. There was a similar question on this list a couple of weeks ago, but that one was about signing the incoming request. My current approach is, in HttpHandler.handleRequest(): - Create a javax.crypto.Signature object - Use HttpServerExchange. addResponseWrapper() to add a StreamSinkConduit that updates the Signature object as write() is called - Use HttpServerExchange.addResponseCommitListener() to add a callback that calls Signature.sign() when the response is ready to be sent Good in theory, but I'm finding that the sign happens before the updates - looks like the Conduit is only active as the response is being sent. Is there something else I should wrap to get the bytes as they're being added to the response? Even better would be if I could read them directly from the ResponseCommitListener.beforeCommit() callback. I can see the number of bytes that have been written, but not the actual data. Note: I'm using Undertow 1.2.x, as we're on WildFly 9. -- Vikas Nagaraj vikas.nagaraj at safenet-inc.com -- The information contained in this electronic mail transmission may be privileged and confidential, and therefore, protected from disclosure. If you have received this communication in error, please notify us immediately by replying to this message and deleting it from your computer without copying or disclosing it. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20160217/b8fc62ab/attachment.html From sdouglas at redhat.com Wed Feb 17 17:54:51 2016 From: sdouglas at redhat.com (Stuart Douglas) Date: Wed, 17 Feb 2016 17:54:51 -0500 (EST) Subject: [undertow-dev] How to get response bytes before they are sent In-Reply-To: References: Message-ID: <70655467.27085315.1455749691066.JavaMail.zimbra@redhat.com> You need to buffer the whole response yourself, by default Undertow will just sent the bytes straight to the socket, so the headers will already be sent by the time the response is finished. You will need to write a StreamSinkConduit implementation that buffers the full response, then when terminateWrites() is called you sign the request using the buffered data, and then try and write out the buffered data. If it can't all be written out you finish writing it in the flush() method. Stuart ----- Original Message ----- > From: "Vikas Nagaraj" > To: undertow-dev at lists.jboss.org > Sent: Thursday, 18 February, 2016 6:10:49 AM > Subject: [undertow-dev] How to get response bytes before they are sent > > Hello, > Is it possible to get the full content of a response body before it?s sent? > I?m trying to sign the response and add this signature in a header. There > was a similar question on this list a couple of weeks ago, but that one was > about signing the incoming request. My current approach is, in > HttpHandler.handleRequest(): > - Create a javax.crypto.Signature object > - Use HttpServerExchange. addResponseWrapper() to add a StreamSinkConduit > that updates the Signature object as write() is called > - Use HttpServerExchange.addResponseCommitListener() to add a callback that > calls Signature.sign() when the response is ready to be sent > Good in theory, but I?m finding that the sign happens before the updates ? > looks like the Conduit is only active as the response is being sent. Is > there something else I should wrap to get the bytes as they?re being added > to the response? Even better would be if I could read them directly from the > ResponseCommitListener.beforeCommit() callback. I can see the number of > bytes that have been written, but not the actual data. > Note: I?m using Undertow 1.2.x, as we?re on WildFly 9. > -- > Vikas Nagaraj > vikas.nagaraj at safenet-inc.com > > The information contained in this electronic mail transmission > may be privileged and confidential, and therefore, protected > from disclosure. If you have received this communication in > error, please notify us immediately by replying to this > message and deleting it from your computer without copying > or disclosing it. > > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From anastasiosl at thinknear.com Tue Feb 23 20:21:26 2016 From: anastasiosl at thinknear.com (Anastasios Livogiannis) Date: Tue, 23 Feb 2016 17:21:26 -0800 Subject: [undertow-dev] Undertow and JMX Message-ID: Hello, Does Undertow support JMX for remote management? Is there any documentation that explains how JMX can be set up for Undertow? I would assume it's similar to the "sibling" projects WildFly and JBoss AS (use remote+http protocol and jboss-client.jar but I haven't made it to work, so I am wondering what I am missing). Thanks -- -- *Anastasios Livogiannis* *Think**near* | Software Engineer -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20160223/d363f2a2/attachment.html From sdouglas at redhat.com Wed Feb 24 16:36:47 2016 From: sdouglas at redhat.com (Stuart Douglas) Date: Wed, 24 Feb 2016 16:36:47 -0500 (EST) Subject: [undertow-dev] Undertow and JMX In-Reply-To: References: Message-ID: <1541638785.29763415.1456349807311.JavaMail.zimbra@redhat.com> If you are using Wildfly you can use JMX to view anything that is accessible via the management model (under jboss.as.undertow). At the moment standalone undertow does not provide a management MBean, although if you file a feature request it is something we could certainly look at adding. Stuart ----- Original Message ----- > From: "Anastasios Livogiannis" > To: undertow-dev at lists.jboss.org > Sent: Wednesday, 24 February, 2016 12:21:26 PM > Subject: [undertow-dev] Undertow and JMX > > Hello, > > Does Undertow support JMX for remote management? Is there any documentation > that explains how JMX can be set up for Undertow? I would assume it's > similar to the "sibling" projects WildFly and JBoss AS (use remote+http > protocol and jboss-client.jar but I haven't made it to work, so I am > wondering what I am missing). > > Thanks > > -- > -- > Anastasios Livogiannis > Think near | Software Engineer > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev