tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Kildén <karl.kil...@gmail.com>
Subject Learning EJB with CDI background
Date Thu, 24 Oct 2013 17:39:38 GMT
Hello,

as someone who previously used only plain tomcat I finally decided to let
go of old principles and start using parts of EJB that looks promising.

I am very quite accustomed to CDI and I must say the syntax I've seen in
most examples so far is confusing and for the most part not so pretty.
Anyways I would just like to clear out some fundamentals to see if I got
this right.

*What I want: *Message Driven Beans are my main reason for wanting in. My
interpretation is that I can get a pool with MDB instances consuming
messages asynchronously with a transactional nature. It's sounds like
something that could scale out well as a Middleware and I need just that.

*How I tried it (based of tomee examples): *
*
*
https://gist.github.com/karlkilden/7141469  <---- My MDB

https://gist.github.com/karlkilden/7141488 <----- My Example Msg Producer


The following are my questions:

1. Does it look "right"?

2. Must my producer use name = "some name" for the @Resource injection of
the queue and my @MessageDriven have that good awful
 @ActivationConfigProperty to map them together?

3.  Can use a MDB with just a @MessageDriven (since no values seems
mandatory)? I tried that but it didn't work so It confused me.

4.  I Inject a ConnectionFactory with @Resource. Can I inject it with
@Inject? Why not @Inject the session directly? Can I fix it with a CDI
producer?


Any good resource for some more fundamentals and updated for EE7 (or at
least EE6)?  For example I don't understand what's supposed to go
in ejb-jar.xml and tomee.xml. I don't get the concept of "mappedBy".

Finally, When I run my example it looks right and my loggers behaves as if
it got the message but in the log i get the following:

okt 24, 2013 7:08:57 EM org.apache.geronimo.connector.work.WorkerContext run
INFO: Removing non-required WorkContextHandler with no context:
org.apache.geronimo.connector.work.TransactionContextHandler@6df8723c
okt 24, 2013 7:08:57 EM org.apache.geronimo.connector.work.WorkerContext run
INFO: Removing non-required WorkContextHandler with no context:
org.apache.openejb.core.security.SecurityContextHandler@1d643ec6
okt 24, 2013 7:08:57 EM org.apache.geronimo.connector.work.WorkerContext run
INFO: Removing non-required WorkContextHandler with no context:
org.apache.geronimo.connector.work.HintsContextHandler@41561668


I don't understand what that means. However very few libraries log frequent
happy flows so It has me concerned...

Thanks for reading, cheers

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message