Can a Message Driven bean implement a different interface than MessageListener?

I am new to java enterprise and trying to understand message driven beans. I implemented MDB along with the remote interface, wanting my MDB to implement both the MessageListener and the RemoteEjbSenderInterface. Similar:

@Remote
public interface RemoteEjbSenderInterface
{
public void sendMessage(String mess) throws JMSException;
}

and MDB

@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName =    
                                       "messageSelector", propertyValue = "SenderType = 
                                        Receiver"),
                    @ActivationConfigProperty(propertyName =  
                                        "destinationType", propertyValue = 
                                        "javax.jms.Queue"),
                    @ActivationConfigProperty(propertyName = 
                                        "destination", propertyValue = "queue/test")})
public class EjbSender implements MessageListener, RemoteEjbSenderInterface
{
 ...    
}

The problem is that when I deploy the application, I get an error message:

Called: org.jboss.as.server.deployment.DeploymentUnitProcessingException: EJB 3.1 FR 5.4.2 MessageDrivenBean com.ericsson.ejb.sender.EjbSender does not implement 1 interface and does not specify a message listener interface

it makes me think, maybe the message is controlled by a bean can ONLY implement the MessageListener interface and nothing more?

Thank you in advance for your help.

+4
1

, , , messageListenerInterface @MessageDriven.

:

@MessageDriven(messageListenerInterface=MessageListener.class)
+8

Source: https://habr.com/ru/post/1540481/


All Articles