librabbitmq-objc icon indicating copy to clipboard operation
librabbitmq-objc copied to clipboard

large message size

Open ghost opened this issue 11 years ago • 5 comments

hi :) its me again hehe

thank you for the other fix, i have a new one for large message sizes

again in the file AMQPConsumer.m, lines +- 109

(currently) receivedBytes += frame.payload.body_fragment.len; memcpy(body.bytes, frame.payload.body_fragment.bytes, frame.payload.body_fragment.len);

(new code) void *body_ptr = (char *)body.bytes + receivedBytes; memcpy(body_ptr, frame.payload.body_fragment.bytes, frame.payload.body_fragment.len); receivedBytes += frame.payload.body_fragment.len;

change the way you append the bytes to the structure, that memcpy is only overlapping and when you get (what happened to me) a huge size message, you get just a chunk of the message, that will fix it

:)

ghost avatar Jun 13 '14 16:06 ghost

what rabbitmq-c version do you use?

AlexanderZubkov avatar Jul 17 '14 11:07 AlexanderZubkov

i dont remember exactly which day i downloaded the code (it was about 2 or 3 months ago), but it was this version https://github.com/alanxz/rabbitmq-c/tree/master/librabbitmq anyway, that issue was with the AMPQConsumer.m and not the actual c version, i just wanted to let you know that this issue happened to me and i just solved that way :)

ghost avatar Jul 17 '14 13:07 ghost

Hm, when I've changed it to .a file with headers it gives me errors. Can you PLEASE share the one that you use?

AlexanderZubkov avatar Jul 18 '14 06:07 AlexanderZubkov

https://www.mediafire.com/?7n2hyozwl0v84na thats the code i have that is compiled to a .a lib to use (i had to change a value in amqp_framing.c line 1909 because it was creating a queue with auto_delete value set to false '0' and i needed it with true '1')

my project manager is the one who builds the lib.a with an .sh script, im afraid i cant provide you with that since i do not have it :/

ghost avatar Jul 18 '14 13:07 ghost

I'm the project manager that he's talking about. I'm not able to share the actual script that I use to build, but the best source that I have ever found after literally 6 months of searching has been:

https://github.com/EFEducationFirstMobile/librabbitmq-objc

For whatever reason this DOES NOT come up in github searches, and it also doesn't come up when you search for "github.com librabbitmq-objc" on google. We've been able to implement it properly and make adjustments but I will say it's kind of corny that you have to modify amqp_framing.c if you want auto delete exchanges.

After fighting with heartbeat induced crashes and eventually just turning them off, the only major issue we are constantly having is dealing with backgrounding on iOS and soft disconnects. They take something like 30 seconds and never actually work(they always throw unknown error -9 for some reason). What we've had to do to get around this is literally destroy the connection by calling amqp_destroy_connection() on the client and let the server clean up the mess on it's end. Kind of messy but hey it works for now.

HT-Stephen avatar Aug 26 '14 14:08 HT-Stephen