@Override protected void onHandleIntent(Intent intent) { Log.v(TAG, "AMQP on Handle Event"); String msg = intent.getStringExtra(Constants.AMQP_PUBLISH_MESSAGE); if (msg == null) return; try { Log.d(TAG, "[q] " + msg); publishQueue.putLast(msg); } catch (InterruptedException e) { e.printStackTrace(); } }
@Override public int onStartCommand(Intent intent, int flags, int startId) { Log.v(TAG, "AMQP onStartCommand"); String msg = intent.getStringExtra(Constants.AMQP_PUBLISH_MESSAGE); if (msg == null) return 0; try { Log.d(TAG, "[q] " + msg); publishQueue.putLast(msg); } catch (InterruptedException e) { e.printStackTrace(); } return 1; }