title: Java Akka websphere pub sub
body: <p>I have two sides of an app running under websphere, </p>
  
  <ol>
  <li>one processing data and submitting it via mq </li>
  <li>one receiving data via mq (message driven bean)</li>
  </ol>
  
  <p>Both sides are joined in a cluster</p>
  
  <pre><code>first.log:INFO  16:02:33.174 [ClusterPacing-akka.actor.default-dispatcher-4] Cluster(akka://ClusterPacing) - Cluster Node [akka.tcp://ClusterPacing@serverone:2531] - Leader is moving node [akka.tcp://ClusterPacing@serverone:2531] to [Up]
  first.log:INFO  16:02:38.123 [ClusterPacing-akka.actor.default-dispatcher-2] Cluster(akka://ClusterPacing) - Cluster Node [akka.tcp://ClusterPacing@serverone:2531] - Leader is moving node [akka.tcp://ClusterPacing@serverone:2532] to [Up]
  </code></pre>
  
  <p>I created a topic subscriber for topic 'ReportStatus'</p>
  
  <pre><code>public void onReceive(Object message) {
  
      log.info("Received message: " + message);
  
      if (message instanceof SubscribeAck)
          log.info("Subscribed to: " + ((SubscribeAck) message).subscribe().topic());
      else if (message instanceof Report) {
          BatchedItemExecutionReport report = (Report) message;
          log.info("Received report: " + report + " from "
                  + getSender());
      } else {
          unhandled(message);
      }
  }
  </code></pre>
  
  <p>successfully as seen from the log file (first.log)</p>
  
  <pre><code>INFO  16:02:31.665 [server.startup : 2] sample.app.App - created BatchPacer: Actor[akka://ClusterPacing/user/BatchPacer#-1219521740]
  INFO  16:02:31.665 [ClusterPacing-akka.actor.default-dispatcher-4] listeners.pacing.BatchPacer - Subscribing to: ReportStatus
  INFO  16:02:31.720 [ClusterPacing-akka.actor.default-dispatcher-4] listeners.pacing.BatchPacer - Received message:     SubscribeAck(Subscribe(omsReportStatus,None,Actor[akka://ClusterPacing/user/BatchPacer#-1219521740]))
  INFO  16:02:31.721 [ClusterPacing-akka.actor.default-dispatcher-4] listeners.pacing.BatchPacer - Subscribed to: ReportStatus
  </code></pre>
  
  <p>And a publisher</p>
  
  <pre><code>public class ReportPublisher extends UntypedActor {
  private static final Logger log = LoggerFactory.getLogger(ReportPublisher.class);
  
  private ActorRef mediator = null;
  
  private ActorSystem actorSystem = null;
  
  int jobCounter = 0;
  
  public ReportPublisher (ActorSystem actorSystem) {
      this.actorSystem = actorSystem;
      mediator = DistributedPubSubExtension.get(actorSystem).mediator();
  }
  
  public static Props props(final ActorSystem actorSystem) {
      return Props.create(new Creator&lt;ReportPublisher &gt;() {
          private static final long serialVersionUID = 1L;
  
          @Override
          public ReportPublisher create() throws Exception {
              return new ReportPublisher(actorSystem);
          }
      });
  }
  
  @Override
  public void onReceive(Object message) {
      log.info("message: " + message);
      if (message instanceof Report) {
          Report report = (Report) message;
          log.info("got: " + report);
          publish(report);
      } else {
          unhandled(message);
      }
  }
  
  void publish(Report report) {
      log.info("Sending: " + report);
      mediator.tell(new DistributedPubSubMediator.Publish(
              REPORT_STATUS_TOPIC, report), getSelf());
      log.info("Sent.");
  }
  }
  </code></pre>
  
  <p>when somewhere in the code I call</p>
  
  <pre><code>reportPublisher.tell(report,null);
  </code></pre>
  
  <p>the message get sent as seen in second.log</p>
  
  <pre><code>INFO  16:03:34.896 [ClusterPacing-akka.actor.default-dispatcher-4] oms.app.ReportPublisher - message: Report[Exception:null, ReportError:null, GatewayError:null, , id:15042002200380001]
  INFO  16:03:34.896 [ClusterPacing-akka.actor.default-dispatcher-4] oms.app.ReportPublisher - got: Report[Exception:null, ReportError:null, GatewayError:null, , id:15042002200380001]
  INFO  16:03:34.897 [ClusterPacing-akka.actor.default-dispatcher-4] oms.app.ReportPublisher - Sending: Report[Exception:null, ReportError:null, GatewayError:null, , id:15042002200380001]
  INFO  16:03:34.897 [ClusterPacing-akka.actor.default-dispatcher-4] oms.app.ReportPublisher - Sent.
  </code></pre>
  
  <p>only it's never received on the topic subscriber...</p>
  
  <p>Config file is as follows</p>
  
  <pre><code>akka {
  
      loglevel = "DEBUG"
      actor.debug.unhandled = on
  
      extensions = ["akka.contrib.pattern.DistributedPubSubExtension"]
  
      actor {
                      provider = "akka.cluster.ClusterActorRefProvider"
      }
  
      remote {
              enabled-transports = ["akka.remote.netty.tcp"]
              netty.tcp {
                      hostname = serverone
                      port = 0
              }
      }
  
      cluster {
          seed-nodes= [
                      "akka.tcp://ClusterPacing@serverone:2531",
                      "akka.tcp://ClusterPacing@serverone:2532"
              ]
      }
  }
  </code></pre>
  
  <p>Once again, this code runs in websphere as two separate apps joining the same (for now local) cluster</p>
  
  <p>I wrote initially a standalone java app just to make sure the code works, and ... it works but NOT in Websphere</p>
  
  <p>What am I doing wrong?!?</p>
  
  <p>Thanks</p>