[JBoss Messaging] - Re: Messaging 1.3 Clustering question
by tim.shaw
Yes, but the distributed queue example opens 2 connections (which are given out round-robin as expected) and sends a single message on one and receives it on the other. This may be a distributed queue, but doesn't show load balancing.
What I am trying to do is send 200000 (or, for testing, 100) onto a single queue and have the clustered machines service these (via MDB's) using a load-balancer. I am happy with a round-robin for now :-)
I believe this is a valid use case!
Is this possible? I assumed it was ... MQ would service the messages round-robin, and JBM is supposed to be better!
Are there any examples of such a configuration around? I can only get one of the machines to service the messages - which one depends on the ClusteredConnectionFactory of course.
Thanks
tim
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113902#4113902
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113902
18 years, 4 months
[JBoss Seam] - implementing SMPC questions
by asookazian
So I'm trying to replace the EntityManager that is injected into my SFSB via @PersistenceContext with a SMPC (Seam Managed Persistence Context) as follows:
import org.jboss.seam.annotations.In;
| import javax.persistence.EntityManager;
|
| @In(create=true)
| EntityManager em; //a Seam-managed persistence context
1) I'm still getting "@In attribute requires non-null value: securityAuditAction.em" when I run my test case even after adding the create=true element setting in the @In attribute. How can I fix that?
2) The previous code was as follows:
@PersistenceContext(unitName="boIcomsSecurityAudit", type=PersistenceContextType.EXTENDED)
| private EntityManager em;
Note that I have multiple persistence units in my persistence.xml as well as multiple datasources in my *-ds.xml. How will the SMPC know which datasource or persistence unit to use? The optional elements for @In are required, create, scope, value.
3) The reason I'm converting to SMPC to begin with is due to the premature update that was happening in my use case (still don't know exactly where/why but think it may be flushMode=auto [default] related). I read section 8.3.3 of the Seam and O/R mapping section of the docs and it sounds like this SMPC strategy will fix my problem (i.e. manual flush at end of conversation only).
4) is the SMPC similar to JPA EXTENDED persistence context type in that the JPA entities are not released (unmanaged) from the PC?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113900#4113900
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113900
18 years, 4 months
[JBoss Seam] - Dependency Injection in Domain Model / Seam / Hibernate / Gu
by chane
I have a fairly standard architecture for my application. I'm using SFSB/SLSB Seam components with IN/OUT injection. These methods call the EntityManager (e.g., find()) to interact with the database.
| @Name("seam.editor")
| @Stateful
| public class SeamEditor implements ISeamEditor{
| @In EntityManager em;
|
| @Out DomainModelObject dmo;
| public String executeAction(){
| dmo = em.find(DomainModelObject.class, new Long(9));
| dmo.performSomeAction();
| }
| }
|
Deep in the object graph returned by the the EntityManager, a domain model object sometimes needs to call a service to obtain another resource. Right now, these services are static method calls.
| @Entity
| public class DeepDomainObject{
|
| private long id;
|
| public String calculateSomething(){
| ..snip...
|
| String resut = DAService.getSomeInformationFromAnotherService();
|
| ..snip...
| }
|
| }
|
The domain object is created by the EntityManager (using Jboss 4.0.x) via lazy loading using (or eager fetching). So there isn't any DI injection from Seam of the EJB (3) container. And I'm pretty sure I don't want it to come from the container as we want to run unit tests outside the container (which will not hit the db).
We've now run into the unit testing issue that we want to mock out the static method call. We're exploring different options (Factory creation) and different DI mechanisms.
What have others done? Does anyone have experience with Guice in this type of situation?
Thanks in advance,
Chris....
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113898#4113898
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113898
18 years, 4 months