Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
miccar committed Apr 14, 2016
1 parent b115dec commit dac3b6b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ public void onMessage(Message msg) {

if(!infoWorkers.containsKey(ID))
{

processInfoForCopyLog(info,ID);
getConnection().createTopic(ID, 1);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public static void main(String[] args){
server.setHandler(ctx);
//Launch activeMq server
ActiveMQStarter amqS = new ActiveMQStarter();

amqS.startActivemq();
try {
server.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
import org.apache.activemq.usage.TempUsage;
import org.apache.activemq.usage.UsageCapacity;

import it.isislab.dmason.util.connection.Address;
import it.isislab.dmason.util.connection.jms.activemq.ConnectionNFieldsWithActiveMQAPI;

/**
* Start Activemq
* @author miccar
Expand Down Expand Up @@ -54,6 +57,9 @@ public ActiveMQStarter(){
IP_ACTIVEMQ=startProperties.getProperty("ipmaster");
PORT_ACTIVEMQ=startProperties.getProperty("portmaster");
System.out.println(IP_ACTIVEMQ +" "+PORT_ACTIVEMQ);



} catch (IOException e2) {
System.err.println(e2.getMessage());
}finally{
Expand Down Expand Up @@ -97,6 +103,12 @@ public void startActivemq(){
/* end code for tempUsage setting */
broker.addConnector(address);
broker.start();

ConnectionNFieldsWithActiveMQAPI conn=new ConnectionNFieldsWithActiveMQAPI();
conn.setupConnection(new Address(IP_ACTIVEMQ, PORT_ACTIVEMQ));
conn.createTopic("MANAGEMENT", 1);


} catch (Exception e1) {e1.printStackTrace();}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,19 @@ class MasterChecker extends Thread{
Random r=new Random();
public MasterChecker() {
timeToCheck=0;

}
@Override
public void run() {
do
{
System.out.println("Start Mater monitor...");
if(masterlost==null)
{

masterlost=new MasterLostChecker();
masterlost.start();
System.out.println("done.");

try {
lock.lock();
Expand Down Expand Up @@ -309,9 +311,9 @@ private void startMasterComunication() {
catch (Exception e1) {e1.printStackTrace();}


masterchecker=new MasterChecker();
masterchecker.start();

//masterchecker=new MasterChecker();
// masterchecker.start();
new MasterLostChecker().start();
conn.asynchronousReceive(MANAGEMENT, new MyMessageListener() {
@Override
public void onMessage(Message msg) {
Expand Down

0 comments on commit dac3b6b

Please sign in to comment.