tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Dale <jcdw...@gmail.com>
Subject Re: Initiating httpservletrequest from inside Tomcat / TomEE
Date Tue, 30 Apr 2019 15:22:41 GMT
This is one of my favorite things.

You'll need to retransmit headers, but by and large it's doable.

Management of contexts can be tricky. Don't forget that the target
service will have a difference context (database connection context
has bitten me in the past on this type of task).

I do my session management in the database, bypassing tomcat's session
management.  The session affinity being in the database has proven
VERY useful to me when extending and integrating my code

I'm not sure if you'll have this luxury, though.

This type of Internet plumbing is powerful, but also can allude to
some scary topics.

Good luck!


On 4/29/19, Paul Carter-Brown <paul.carter-brown@jini.guru> wrote:
> Hi
>
> I'm trying to design a Kafka consumer and producer that will run inside the
> tomcat jvm and pick up messages off a Kafka topic and translate them into a
> servlet request and pass it through tomcat and then when the response is
> complete then translate it into a Kafka message and put it onto another
> topic as a reply. This way I can reuse our existing jax-rs rest services
> and expose them as an async api over Kafka. The idea is to make the Kafka
> messages similar to http in that they would consist of headers and a body.
> The body would be json.
>
> Now I know this could be done by calling localhost with an http call to
> trombone the requests back into tomcat but I'd like to avoid the associated
> latency and overhead. Is it possible to call tomcat directly in-process.
> This does not need to be portable to other containers so can be
> proprietary.
>
> I'm using tomcat 8. In fact its tomee 8 but guessed this is more a tomcat
> question than tomee but have sent to both groups just in case.
>
> Thanks for any insights.
>
> Paul
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message