title: Making a consumer as an inner class in the serviceImpl
body: <p>I have a problem scanning the consumer that I made as an inner class inside my serviceimpl.java</p>
  
  <p>code below:</p>
  
  <pre><code>public class CredsServiceImpl implements CredsService {
  @Service
  public static class userCredsConsumer implements Consumer&lt;Event&lt;UserData&gt;&gt; {
      private final Logger log = LoggerFactory.getLogger(userCredsConsumer.class);
  
      @Autowired
      EntityManager entityManager;
      @Autowired
      CredsDAO credsDAO;
  
      public void accept(Event&lt;UserData&gt; notificationDataEvent) {
          UserData notificationData = notificationDataEvent.getData();
          entityManager.setEntityId(notificationData.getTenantId());
          List&lt;CredsDTO&gt; credsUser = credsDAO.selectByUserId(notificationData.getUserId());
          if(credsUser == null || credsUser.isEmpty()){
              log.info("No Existing Credential Watcher Record for User [{}]", notificationData.getUserName());
          }else{
              credsDAO.deleteByUserId(notificationData.getUserId());
              log.info("Creds Record for User [{}] is Deleted", notificationData.getUserName());
          }
      }  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and I am trying to access it from the credentialconfig that I made</p>
  
  <pre><code>@Autowired
  private EventBus eventBus;
  
  @Autowired
  UserCredsConsumer userCredsConsumer;
  
  @PostConstruct
  public void postConstruct() {
      eventBus.on($("userCredsConsumer"), userCredsConsumer);
  }
  </code></pre>
  
  <p>the problem I have right now is it is not going the the userCredsConsumer class that I made in the serviceimpl.</p>
  
  <p>any insights would help.. if I don't make it as an inner class it is working fine. but if I make it as an inner class its not working properly.. but I really need this to be in an inner class for specific reasons in the business.</p>