You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by da...@apache.org on 2008/06/16 17:46:41 UTC
svn commit: r668204 - in
/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src:
handlers/ storage/sqlite/
Author: damitha
Date: Mon Jun 16 08:46:41 2008
New Revision: 668204
URL: http://svn.apache.org/viewvc?rev=668204&view=rev
Log:
Working on dropping duplicatte messsages.
Modified:
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_in_handler.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_create_seq_mgr.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_next_msg_mgr.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_seq_property_mgr.c
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_in_handler.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_in_handler.c?rev=668204&r1=668203&r2=668204&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_in_handler.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_in_handler.c Mon Jun 16 08:46:41 2008
@@ -182,11 +182,18 @@
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] msg_ctx dropped. So return here");
if(rm_msg_ctx)
+ {
sandesha2_msg_ctx_free(rm_msg_ctx, env);
+ }
if(seq_prop_mgr)
+ {
sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
+ }
if(storage_mgr)
+ {
sandesha2_storage_mgr_free(storage_mgr, env);
+ }
+
return AXIS2_SUCCESS;
}
/*
@@ -253,8 +260,6 @@
{
axis2_bool_t drop = AXIS2_FALSE;
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2] Entry:sandesha2_in_handler_drop_if_duplicate");
AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FALSE);
AXIS2_PARAM_CHECK(env->error, storage_mgr, AXIS2_FALSE);
@@ -289,7 +294,9 @@
int i = 0, size = 0;
rcvd_msgs_str = sandesha2_seq_property_bean_get_value(rcvd_msgs_bean, env);
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "rcvd_msgs_str:%s*************", rcvd_msgs_str);
+
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "rcvd_msgs_str:%s", rcvd_msgs_str);
+
msg_no_list = sandesha2_utils_get_array_list_from_string(env, rcvd_msgs_str);
if(msg_no_list)
{
@@ -383,8 +390,7 @@
rm_msg_ctx, env), env);
if(!op_ctx && !op_ctx1)
{
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] Dropping"
- " duplicate RM message");
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] Dropping duplicate RM message");
drop = AXIS2_TRUE;
}
}
@@ -394,8 +400,7 @@
sandesha2_msg_ctx_set_paused(rm_msg_ctx, env, AXIS2_TRUE);
return AXIS2_TRUE;
}
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_in_handler_drop_if_duplicate");
+
return AXIS2_FALSE;
}
@@ -409,40 +414,54 @@
sandesha2_seq_property_mgr_t *seq_prop_mgr,
sandesha2_sender_mgr_t *sender_mgr)
{
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "[sandesha2] Entry:sandesha2_in_handler_process_dropped_msg");
+
AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FALSE);
AXIS2_PARAM_CHECK(env->error, storage_mgr, AXIS2_FALSE);
- if(SANDESHA2_MSG_TYPE_APPLICATION == sandesha2_msg_ctx_get_msg_type(
- rm_msg_ctx, env))
+ if(SANDESHA2_MSG_TYPE_APPLICATION == sandesha2_msg_ctx_get_msg_type(rm_msg_ctx, env))
{
sandesha2_seq_t *sequence = NULL;
axis2_char_t *rmd_sequence_id = NULL;
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "came1");
sequence = sandesha2_msg_ctx_get_sequence(rm_msg_ctx, env);
if(sequence)
- rmd_sequence_id = sandesha2_identifier_get_identifier(
- sandesha2_seq_get_identifier(sequence, env), env);
+ rmd_sequence_id = sandesha2_identifier_get_identifier(sandesha2_seq_get_identifier(sequence,
+ env), env);
if(rmd_sequence_id)
{
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "came2");
+
sandesha2_seq_property_bean_t *rcvd_msgs_bean = NULL;
axis2_char_t *rcvd_msgs_str = NULL;
sandesha2_msg_processor_t *app_msg_processor = NULL;
- rcvd_msgs_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr,
- env, rmd_sequence_id, SANDESHA2_SEQ_PROP_SERVER_COMPLETED_MESSAGES);
+ rcvd_msgs_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, rmd_sequence_id,
+ SANDESHA2_SEQ_PROP_SERVER_COMPLETED_MESSAGES);
+
if(rcvd_msgs_bean)
{
- rcvd_msgs_str = sandesha2_seq_property_bean_get_value(
- rcvd_msgs_bean, env);
+ rcvd_msgs_str = sandesha2_seq_property_bean_get_value(rcvd_msgs_bean, env);
+
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "rcvd_msgs_str:%s", rcvd_msgs_str);
+
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "came3");
+
app_msg_processor = sandesha2_app_msg_processor_create(env);
sandesha2_app_msg_processor_send_ack_if_reqd(env, rm_msg_ctx, rcvd_msgs_str,
rmd_sequence_id, storage_mgr, sender_mgr, seq_prop_mgr);
+
sandesha2_msg_processor_free(app_msg_processor, env);
}
}
}
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "[sandesha2] Exit:sandesha2_in_handler_process_dropped_msg");
+
return AXIS2_SUCCESS;
}
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_create_seq_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_create_seq_mgr.c?rev=668204&r1=668203&r2=668204&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_create_seq_mgr.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_create_seq_mgr.c Mon Jun 16 08:46:41 2008
@@ -263,15 +263,13 @@
sandesha2_permanent_create_seq_mgr_t *seq_mgr_impl = NULL;
axis2_char_t sql_remove[256];
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Entry:sandesha2_permanent_create_seq_mgr_remove");
AXIS2_PARAM_CHECK(env->error, msg_id, AXIS2_FALSE);
+
seq_mgr_impl = SANDESHA2_INTF_TO_IMPL(seq_mgr);
sprintf(sql_remove, "delete from create_seq where create_seq_msg_id='%s';",
msg_id);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_permanent_create_seq_mgr_remove");
+
return sandesha2_permanent_bean_mgr_remove(seq_mgr_impl->bean_mgr, env,
sql_remove);
}
@@ -286,6 +284,7 @@
sandesha2_permanent_create_seq_mgr_t *seq_mgr_impl = NULL;
AXIS2_PARAM_CHECK(env->error, msg_id, AXIS2_FALSE);
+
seq_mgr_impl = SANDESHA2_INTF_TO_IMPL(seq_mgr);
sprintf(sql_retrieve, "select create_seq_msg_id, internal_seq_id,"\
@@ -313,6 +312,7 @@
axis2_char_t *ref_msg_store_key = NULL;
AXIS2_PARAM_CHECK(env->error, bean, AXIS2_FALSE);
+
create_seq_msg_id = sandesha2_create_seq_bean_get_create_seq_msg_id(
bean, env);
internal_seq_id = sandesha2_create_seq_bean_get_internal_sequence_id(bean, env);
@@ -326,6 +326,7 @@
",create_seq_msg_store_key='%s', ref_msg_store_key='%s' where "\
"create_seq_msg_id='%s';", internal_seq_id, seq_id,
create_seq_msg_store_key, ref_msg_store_key, create_seq_msg_id);
+
ret = sandesha2_permanent_bean_mgr_update(seq_mgr_impl->bean_mgr, env, sql_update);
return ret;
@@ -401,7 +402,9 @@
int size = 0;
sandesha2_create_seq_bean_t *result = NULL;
axutil_array_list_t *find_list = NULL;
+
AXIS2_PARAM_CHECK(env->error, bean, AXIS2_FALSE);
+
find_list = sandesha2_permanent_create_seq_mgr_find(seq_mgr, env, bean);
if(find_list)
size = axutil_array_list_size(find_list, env);
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_next_msg_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_next_msg_mgr.c?rev=668204&r1=668203&r2=668204&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_next_msg_mgr.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_next_msg_mgr.c Mon Jun 16 08:46:41 2008
@@ -258,8 +258,6 @@
long msg_no;
sandesha2_permanent_next_msg_mgr_t *next_msg_mgr_impl = NULL;
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Entry:sandesha2_permanent_next_msg_mgr_insert");
AXIS2_PARAM_CHECK(env->error, bean, AXIS2_FALSE);
seq_id = sandesha2_next_msg_bean_get_seq_id(bean,
@@ -275,8 +273,7 @@
"ref_msg_key,"\
"polling_mode, msg_no) values('%s', '%s', '%s', %d, %ld);", seq_id,
internal_seq_id, ref_msg_key, polling_mode, msg_no);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_permanent_next_msg_mgr_insert");
+
return sandesha2_permanent_bean_mgr_insert(next_msg_mgr_impl->bean_mgr, env,
sql_insert);
}
@@ -289,14 +286,12 @@
{
axis2_char_t sql_remove[256];
sandesha2_permanent_next_msg_mgr_t *next_msg_mgr_impl = NULL;
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Entry:sandesha2_permanent_next_msg_mgr_remove");
+
AXIS2_PARAM_CHECK(env->error, seq_id, AXIS2_FALSE);
next_msg_mgr_impl = SANDESHA2_INTF_TO_IMPL(next_msg_mgr);
sprintf(sql_remove, "delete from next_msg where seq_id='%s'",
seq_id);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_permanent_next_msg_mgr_remove");
+
return sandesha2_permanent_bean_mgr_remove(next_msg_mgr_impl->bean_mgr, env,
sql_remove);
}
@@ -313,15 +308,13 @@
AXIS2_PARAM_CHECK(env->error, seq_id, AXIS2_FALSE);
next_msg_mgr_impl = SANDESHA2_INTF_TO_IMPL(next_msg_mgr);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Entry:sandesha2_permanent_next_msg_mgr_retrieve");
+
sprintf(sql_retrieve, "select seq_id, internal_seq_id, ref_msg_key, "\
"polling_mode, msg_no from next_msg where seq_id='%s';", seq_id);
bean = (sandesha2_next_msg_bean_t *) sandesha2_permanent_bean_mgr_retrieve(
next_msg_mgr_impl->bean_mgr, env, sandesha2_next_msg_retrieve_callback,
sql_retrieve);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_permanent_next_msg_mgr_retrieve");
+
return bean;
}
@@ -339,8 +332,7 @@
axis2_char_t *ref_msg_key = NULL;
axis2_bool_t polling_mode = AXIS2_FALSE;
long msg_no;
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Entry:sandesha2_permanent_next_msg_mgr_update");
+
AXIS2_PARAM_CHECK(env->error, bean, AXIS2_FALSE);
seq_id = sandesha2_next_msg_bean_get_seq_id(bean,
env);
@@ -358,8 +350,7 @@
polling_mode, msg_no, seq_id);
ret = sandesha2_permanent_bean_mgr_update(next_msg_mgr_impl->bean_mgr, env,
sql_update);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_permanent_next_msg_mgr_update");
+
return ret;
}
@@ -377,8 +368,7 @@
axutil_array_list_t *find_list = NULL;
sandesha2_permanent_next_msg_mgr_t *next_msg_mgr_impl = NULL;
next_msg_mgr_impl = SANDESHA2_INTF_TO_IMPL(next_msg_mgr);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Entry:sandesha2_permanent_next_msg_mgr_find");
+
if(bean)
{
seq_id = sandesha2_next_msg_bean_get_seq_id(bean,
@@ -423,8 +413,6 @@
find_list = sandesha2_permanent_bean_mgr_find(next_msg_mgr_impl->bean_mgr,
env, sandesha2_next_msg_find_callback, sql_find);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_permanent_next_msg_mgr_find");
return find_list;
}
Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_seq_property_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_seq_property_mgr.c?rev=668204&r1=668203&r2=668204&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_seq_property_mgr.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_seq_property_mgr.c Mon Jun 16 08:46:41 2008
@@ -241,9 +241,8 @@
axis2_char_t *name = NULL;
axis2_char_t *value = NULL;
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Entry:sandesha2_permanent_seq_property_mgr_insert");
AXIS2_PARAM_CHECK(env->error, bean, AXIS2_FALSE);
+
id = sandesha2_permanent_seq_property_mgr_get_id_with_bean(env, bean);
seq_id = sandesha2_seq_property_bean_get_seq_id(bean, env);
name = sandesha2_seq_property_bean_get_name(bean, env);
@@ -257,8 +256,6 @@
AXIS2_FREE(env->allocator, id);
ret = sandesha2_permanent_bean_mgr_insert(seq_prop_mgr_impl->bean_mgr, env,
sql_insert);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_permanent_seq_property_mgr_insert");
return ret;
}
@@ -273,11 +270,10 @@
axis2_char_t sql_remove[256];
axis2_status_t status = AXIS2_FAILURE;
sandesha2_permanent_seq_property_mgr_t *seq_prop_mgr_impl = NULL;
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Entry:sandesha2_permanent_seq_property_mgr_remove");
AXIS2_PARAM_CHECK(env->error, seq_id, AXIS2_FALSE);
AXIS2_PARAM_CHECK(env->error, name, AXIS2_FALSE);
+
seq_prop_mgr_impl = SANDESHA2_INTF_TO_IMPL(seq_prop_mgr);
key = sandesha2_permanent_seq_property_mgr_get_id_with_seq_id_and_name(env,
seq_id, name);
@@ -285,8 +281,6 @@
status = sandesha2_permanent_bean_mgr_remove(seq_prop_mgr_impl->bean_mgr, env,
sql_remove);
AXIS2_FREE(env->allocator, key);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_permanent_seq_property_mgr_remove");
return status;
}
@@ -302,11 +296,9 @@
sandesha2_seq_property_bean_t *ret = NULL;
sandesha2_permanent_seq_property_mgr_t *seq_prop_mgr_impl = NULL;
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Entry:sandesha2_permanent_seq_property_mgr_retrieve");
AXIS2_PARAM_CHECK(env->error, seq_id, AXIS2_FALSE);
AXIS2_PARAM_CHECK(env->error, name, AXIS2_FALSE);
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]seq_property_name:%s", name);
+
seq_prop_mgr_impl = SANDESHA2_INTF_TO_IMPL(seq_prop_mgr);
key = sandesha2_permanent_seq_property_mgr_get_id_with_seq_id_and_name(env,
seq_id, name);
@@ -316,8 +308,6 @@
seq_prop_mgr_impl->bean_mgr, env, sandesha2_seq_property_retrieve_callback,
sql_retrieve);
AXIS2_FREE(env->allocator, key);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_permanent_seq_property_mgr_retrieve");
return ret;
}
@@ -335,9 +325,8 @@
axis2_char_t *name = NULL;
axis2_char_t *value = NULL;
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Entry:sandesha2_permanent_seq_property_mgr_update");
AXIS2_PARAM_CHECK(env->error, bean, AXIS2_FALSE);
+
id = sandesha2_permanent_seq_property_mgr_get_id_with_bean(env, bean);
seq_id = sandesha2_seq_property_bean_get_seq_id(bean, env);
name = sandesha2_seq_property_bean_get_name(bean, env);
@@ -351,8 +340,6 @@
AXIS2_FREE(env->allocator, id);
ret = sandesha2_permanent_bean_mgr_update(seq_prop_mgr_impl->bean_mgr, env,
sql_update);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_permanent_seq_property_mgr_update");
return ret;
}
@@ -369,8 +356,7 @@
axis2_char_t *value = NULL;
axutil_array_list_t *find_list = NULL;
sandesha2_permanent_seq_property_mgr_t *seq_prop_mgr_impl = NULL;
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Entry:sandesha2_permanent_seq_property_mgr_find");
+
seq_prop_mgr_impl = SANDESHA2_INTF_TO_IMPL(seq_prop_mgr);
if(bean)
{
@@ -413,8 +399,7 @@
find_list = sandesha2_permanent_bean_mgr_find(seq_prop_mgr_impl->bean_mgr,
env, sandesha2_seq_property_find_callback, sql_find);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_permanent_seq_property_mgr_find");
+
return find_list;
}
@@ -427,7 +412,9 @@
int size = 0;
sandesha2_seq_property_bean_t *result = NULL;
axutil_array_list_t *find_list = NULL;
+
AXIS2_PARAM_CHECK(env->error, bean, AXIS2_FALSE);
+
find_list = sandesha2_permanent_seq_property_mgr_find(seq_prop_mgr, env,
bean);
if(find_list)
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org