Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

null MessageBroker

Avatar

Avatar
Validate 1
Level 1
Steve_Pruitt
Level 1

Likes

0 likes

Total Posts

17 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
Steve_Pruitt
Level 1

Likes

0 likes

Total Posts

17 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
Steve_Pruitt
Level 1

01-07-2010

My application needs server push.  I am trying to get a simple "Hello World" going, but I can't get past a null MessageBroker.  I simplified my configuration files and it might be my issue.

My services-config.xml

includes only the messaging and data-management configs:

<service-include file-path="messaging-config.xml"/>
<service-include file-path="data-management-config.xml"/>

channels:

<default-channels>
   <channel ref="my_rtmp"/>
   <channel ref="my_amf"/>
   <channel ref="my_polling-amf"/>
</default-channels>

a single server

<server id="my-nio-server" class="flex.messaging.socketserver.SocketServer">

and i left the channel definitions as defined.

My messaging-config.xml is:

<service id="message-service" class="flex.messaging.services.MessageService">
  <adapters>
    <adapter-definition id="actionscript" class="flex.messaging.services.messaging.adapters.ActionScriptAdapter" default="false"/>
  </adapters>
  <destination id="DocumentSessionTopic">
    <properties>
       <network>
          <subscription-timeout-minutes>0</subscription-timeout-minutes>
       </network>
       <server>
          <max-cache-size>1000</max-cache-size>
          <message-time-to-live>0</message-time-to-live>
          <allow-subtopics>true</allow-subtopics>
          <subtopic-separator>.</subtopic-separator>
          <cluster-message-routing>server-to-server</cluster-message-routing>
      </server>
    </properties>
    <channels>
       <channel ref="my_amf"/>
       <channel ref="my_polling-amf"/>
    </channels>
  </destination>
</service>

My java part is:

MessageBroker msgBroker;
msgBroker = MessageBroker.getMessageBroker(null);
msgBroker.start();

msgBroker is null when I try to invoke its start() method.

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Boost 5
Employee
tomj
Employee

Likes

7 likes

Total Posts

56 posts

Correct Reply

2 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 1
View profile

Avatar
Boost 5
Employee
tomj
Employee

Likes

7 likes

Total Posts

56 posts

Correct Reply

2 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 1
View profile
tomj
Employee

02-08-2010

What context is your Java code being executed in?

You need to be in the same web application as LCDS, so the MessageBrokerServlet will have created and registered the MessageBroker in the static table.  I assume also that you have not defined an identifier in the web.xml for the MessageBroker so the null argument to the get function should find the default instance (named "__default_").

You can take a look at the MessageBroker code in svn here: http://opensource.adobe.com/svn/opensource/blazeds/trunk/modules/core/src/flex/messaging/