muhannad-alhariri / android-stomper

A library for android built on stomp-master library
3 stars 0 forks source link

Error!!!! #1

Open tiomelenas opened 8 years ago

tiomelenas commented 8 years ago

Hi,

i´m very interested in this project.

But I can´t do it work.

I don´t find com.mhariri.stomp.libs.internal.StompJSession class

muhannad-alhariri commented 8 years ago

Hi, Thank you very much for your interest in the priject. I will provide a new version of the code as soon as possible( within 2 days) including the missing classes On 29 Jun 2016 4:35 p.m., "tiomelenas" notifications@github.com wrote:

Hi,

i´m very interested in this project.

But I can´t do it work.

I don´t find com.mhariri.stomp.libs.internal.StompJSession class

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/muhannad-alhariri/android-stomper/issues/1, or mute the thread https://github.com/notifications/unsubscribe/AAxiDOBKVObZLiDJe_REGDTGcCGBgkZfks5qQnSNgaJpZM4JBI1P .

tiomelenas commented 8 years ago

Thanks a lot.

I´m preparing a webinar about Application Integration with Talend Data Integration, and I´d like to show how Talend can processing messages from queues, and I try to make an Android test application to show it.

Thanks a lot!!!

De: Muhannad A.Alhariri [mailto:notifications@github.com] Enviado el: miércoles, 29 de junio de 2016 15:40 Para: muhannad-alhariri/android-stomper CC: tiomelenas; Author Asunto: Re: [muhannad-alhariri/android-stomper] Error!!!! (#1)

Hi, Thank you very much for your interest in the priject. I will provide a new version of the code as soon as possible( within 2 days) including the missing classes On 29 Jun 2016 4:35 p.m., "tiomelenas" notifications@github.com wrote:

Hi,

i´m very interested in this project.

But I can´t do it work.

I don´t find com.mhariri.stomp.libs.internal.StompJSession class

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/muhannad-alhariri/android-stomper/issues/1, or mute the thread https://github.com/notifications/unsubscribe/AAxiDOBKVObZLiDJe_REGDTGcCGBgkZfks5qQnSNgaJpZM4JBI1P .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/muhannad-alhariri/android-stomper/issues/1#issuecomment-229358642 , or mute the thread https://github.com/notifications/unsubscribe/AGy92rotN47yHcYyseDTnUL0nTxdX07Hks5qQnXLgaJpZM4JBI1P . https://github.com/notifications/beacon/AGy92oBSFJRiLXxUvGI35MIP0CDsUaHNks5qQnXLgaJpZM4JBI1P.gif

muhannad-alhariri commented 8 years ago

Great,I will provide you with the code today. On 29 Jun 2016 4:43 p.m., "tiomelenas" notifications@github.com wrote:

Thanks a lot.

I´m preparing a webinar about Application Integration with Talend Data Integration, and I´d like to show how Talend can processing messages from queues, and I try to make an Android test application to show it.

Thanks a lot!!!

De: Muhannad A.Alhariri [mailto:notifications@github.com] Enviado el: miércoles, 29 de junio de 2016 15:40 Para: muhannad-alhariri/android-stomper CC: tiomelenas; Author Asunto: Re: [muhannad-alhariri/android-stomper] Error!!!! (#1)

Hi, Thank you very much for your interest in the priject. I will provide a new version of the code as soon as possible( within 2 days) including the missing classes On 29 Jun 2016 4:35 p.m., "tiomelenas" notifications@github.com wrote:

Hi,

i´m very interested in this project.

But I can´t do it work.

I don´t find com.mhariri.stomp.libs.internal.StompJSession class

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/muhannad-alhariri/android-stomper/issues/1, or mute the thread < https://github.com/notifications/unsubscribe/AAxiDOBKVObZLiDJe_REGDTGcCGBgkZfks5qQnSNgaJpZM4JBI1P

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/muhannad-alhariri/android-stomper/issues/1#issuecomment-229358642> , or mute the thread < https://github.com/notifications/unsubscribe/AGy92rotN47yHcYyseDTnUL0nTxdX07Hks5qQnXLgaJpZM4JBI1P> . < https://github.com/notifications/beacon/AGy92oBSFJRiLXxUvGI35MIP0CDsUaHNks5qQnXLgaJpZM4JBI1P.gif>

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/muhannad-alhariri/android-stomper/issues/1#issuecomment-229359370, or mute the thread https://github.com/notifications/unsubscribe/AAxiDBp2c1hso-tCc4t5KSzkjqJpUHgPks5qQnZpgaJpZM4JBI1P .

muhannad-alhariri commented 8 years ago

Hi

Please download the full project from this new repository

https://github.com/Muhannad-A-Alhariri/android-stomper/

and do not hesitate to ask any question

On 29 Jun 2016 4:43 p.m., "tiomelenas" notifications@github.com wrote:

Thanks a lot.

I´m preparing a webinar about Application Integration with Talend Data Integration, and I´d like to show how Talend can processing messages from queues, and I try to make an Android test application to show it.

Thanks a lot!!!

De: Muhannad A.Alhariri [mailto:notifications@github.com] Enviado el: miércoles, 29 de junio de 2016 15:40 Para: muhannad-alhariri/android-stomper CC: tiomelenas; Author Asunto: Re: [muhannad-alhariri/android-stomper] Error!!!! (#1)

Hi, Thank you very much for your interest in the priject. I will provide a new version of the code as soon as possible( within 2 days) including the missing classes On 29 Jun 2016 4:35 p.m., "tiomelenas" notifications@github.com wrote:

Hi,

i´m very interested in this project.

But I can´t do it work.

I don´t find com.mhariri.stomp.libs.internal.StompJSession class

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/muhannad-alhariri/android-stomper/issues/1, or mute the thread < https://github.com/notifications/unsubscribe/AAxiDOBKVObZLiDJe_REGDTGcCGBgkZfks5qQnSNgaJpZM4JBI1P

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/muhannad-alhariri/android-stomper/issues/1#issuecomment-229358642> , or mute the thread < https://github.com/notifications/unsubscribe/AGy92rotN47yHcYyseDTnUL0nTxdX07Hks5qQnXLgaJpZM4JBI1P> . < https://github.com/notifications/beacon/AGy92oBSFJRiLXxUvGI35MIP0CDsUaHNks5qQnXLgaJpZM4JBI1P.gif>

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/muhannad-alhariri/android-stomper/issues/1#issuecomment-229359370, or mute the thread https://github.com/notifications/unsubscribe/AAxiDBp2c1hso-tCc4t5KSzkjqJpUHgPks5qQnZpgaJpZM4JBI1P .

tiomelenas commented 8 years ago

Thanks a lot Muhannad.

I download the lib, but I can´t try your library.

I have an ActiveMQ server, I want to try to send a message to a queue, and so try to subscribe to a queue.

I have this code (I type it based on your instructions in GitHub page).

public void sendMessage()

   {

         Connection connection = new Connection("x.x.x.x",

                    61613, "user",

                    "pass_user");

         //To Check if connection is live

         if(connection.isConnected()){

                System.out.println(“CONNECTED”);

         } 

         else

         {

                ErrorMessage errMsg = connection.connect();

                if(errMsg == null) {

                       System.out.println(“errMsg succeeded”);

                      //I have to define message like Message of your library
                      // but this Message class don´t have “setProperty” function.
                      message.setProperty("header1", value);
                      message.setContent(messageContent.getBytes());

                      connection.send(message, "/queue/QUEUE_NAME");

                }

         }

   }

Can do you help me?

De: Muhannad A.Alhariri [mailto:notifications@github.com] Enviado el: jueves, 30 de junio de 2016 3:41 Para: muhannad-alhariri/android-stomper CC: tiomelenas; Author Asunto: Re: [muhannad-alhariri/android-stomper] Error!!!! (#1)

Hi

Please download the full project from this new repository

https://github.com/Muhannad-A-Alhariri/android-stomper/

and do not hesitate to ask any question

On 29 Jun 2016 4:43 p.m., "tiomelenas" notifications@github.com wrote:

Thanks a lot.

I´m preparing a webinar about Application Integration with Talend Data Integration, and I´d like to show how Talend can processing messages from queues, and I try to make an Android test application to show it.

Thanks a lot!!!

De: Muhannad A.Alhariri [mailto:notifications@github.com] Enviado el: miércoles, 29 de junio de 2016 15:40 Para: muhannad-alhariri/android-stomper CC: tiomelenas; Author Asunto: Re: [muhannad-alhariri/android-stomper] Error!!!! (#1)

Hi, Thank you very much for your interest in the priject. I will provide a new version of the code as soon as possible( within 2 days) including the missing classes On 29 Jun 2016 4:35 p.m., "tiomelenas" notifications@github.com wrote:

Hi,

i´m very interested in this project.

But I can´t do it work.

I don´t find com.mhariri.stomp.libs.internal.StompJSession class

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/muhannad-alhariri/android-stomper/issues/1, or mute the thread < https://github.com/notifications/unsubscribe/AAxiDOBKVObZLiDJe_REGDTGcCGBgkZfks5qQnSNgaJpZM4JBI1P

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/muhannad-alhariri/android-stomper/issues/1#issuecomment-229358642> , or mute the thread < https://github.com/notifications/unsubscribe/AGy92rotN47yHcYyseDTnUL0nTxdX07Hks5qQnXLgaJpZM4JBI1P> . < https://github.com/notifications/beacon/AGy92oBSFJRiLXxUvGI35MIP0CDsUaHNks5qQnXLgaJpZM4JBI1P.gif>

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/muhannad-alhariri/android-stomper/issues/1#issuecomment-229359370, or mute the thread https://github.com/notifications/unsubscribe/AAxiDBp2c1hso-tCc4t5KSzkjqJpUHgPks5qQnZpgaJpZM4JBI1P .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/muhannad-alhariri/android-stomper/issues/1#issuecomment-229537739 , or mute the thread https://github.com/notifications/unsubscribe/AGy92oa_qJ7sNa0GlL6QbYFTmJpLekWnks5qQx7CgaJpZM4JBI1P . https://github.com/notifications/beacon/AGy92vZmsvAD71cD8cWRubSCxZ3WNoFMks5qQx7CgaJpZM4JBI1P.gif

muhacit commented 8 years ago

Dear @tiomelenas

The problem with your code is that

mConnection = new Connection(SERVER,
                PORT, KFHApplication.USER,
                STOMP_PWD);

mConnection.addMessageHandler(queue, new MessageHandler() {

                    @Override
                    public void onMessage(Message msg) {
//handle code here
}

Also you need to configure ActiveMQ and create some topics like /topic/some_topic

so you can subscribe to

The most important point here is to have the following properties in every message Use DefaultMessage to wrap your message

DefaultMessage message = new DefaultMessage();
message.setProperty("transformation", "jms-map-json");
message.setProperty("type", "jms-map-json");
message.setProperty("persistent", "false");

String messageContent = String.format(messageMap, params...);
message.setContent(messageContent.getBytes());

mConnection.send(message, "/topic/some_topic");

The message map

the message map is POJO object converted to a string like following sample

String messageMap = "{" + "\"map\":" + "{" + "\"entry\":"
            + "[{\"string\":[\"isSender\",\"%s\"]},"
            + "{\"string\":[\"devName\",\"%s\"]},"
            + "{\"string\":[\"uuid\",\"%s\"]},"
            + "{\"string\":[\"service\",\"%s\"]},"
            + "{\"string\":[\"latitude\",\"%s\"]},"
            + "{\"string\":[\"longitude\",\"%s\"]},"
            + "{\"string\":[\"type\",\"%s\"]},"
            + "{\"string\":[\"prevLinkedDev\",\"%s\"]}]" + "}" + "}";

And finally sorry for a very late answer, because had holidays.

tiomelenas commented 8 years ago

Hi,

Thanks for reply!!!

I´m on holidays too, I try it when I come back.

Thanks a lot!!!

De: muhacit [mailto:notifications@github.com] Enviado el: lunes, 11 de julio de 2016 7:41 Para: muhannad-alhariri/android-stomper CC: tiomelenas; Mention Asunto: Re: [muhannad-alhariri/android-stomper] Error!!!! (#1)

Dear @tiomelenas https://github.com/tiomelenas

The problem with your code is that

· you handle the connection.send in case of error, while the code should be moved to (if connection.isconnected) block

· And before you can send to a queue you should subscribe and add a message handler like the following

mConnection = new Connection(SERVER, PORT, KFHApplication.USER, STOMP_PWD);

mConnection.addMessageHandler(queue, new MessageHandler() {

                @Override
                public void onMessage(Message msg) {

//handle code here }

Also you need to configure ActiveMQ and create some topics like /topic/some_topic

so you can subscribe to

The most important point here is to have the following properties in every message Use DefaultMessage to wrap your message

DefaultMessage message = new DefaultMessage(); message.setProperty("transformation", "jms-map-json"); message.setProperty("type", "jms-map-json"); message.setProperty("persistent", "false");

String messageContent = String.format(messageMap, params...); message.setContent(messageContent.getBytes());

mConnection.send(message, "/topic/some_topic");

The message map

the message map is POJO object converted to a string like following sample

String messageMap = "{" + "\"map\":" + "{" + "\"entry\":"

And finally sorry for a very late answer, because had holidays.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/muhannad-alhariri/android-stomper/issues/1#issuecomment-231646532 , or mute the thread https://github.com/notifications/unsubscribe/AGy92uO5ft7GRgUyBkP94E_6TAATlmVJks5qUddkgaJpZM4JBI1P . https://github.com/notifications/beacon/AGy92mMEr5ivIaQb62czA8me8X3QzsD8ks5qUddkgaJpZM4JBI1P.gif