Difference between revisions of "Truxton route message"
Jump to navigation
Jump to search
(→Sample) |
(→Sample) |
||
| Line 14: | Line 14: | ||
=Sample= | =Sample= | ||
| − | <syntaxhighlight lang="C" highlight=" | + | <syntaxhighlight lang="C" highlight="34"> |
| − | void | + | void reroute_file_to_my_custom_route(uint64_t file) |
{ | { | ||
uint64_t message = truxton_message_create(); | uint64_t message = truxton_message_create(); | ||
Revision as of 07:40, 14 June 2020
This sends the message to all ETL processes that have subscribed to it base on the message's route.
Syntax
void truxton_route_message( uint64_t trutxon_handle, uint64_t message_handle );
Parameters
truxton_handle
The handle created by the truxton_create call.
message_handle
The handle created by the truxton_message_create call.
Sample
void reroute_file_to_my_custom_route(uint64_t file)
{
uint64_t message = truxton_message_create();
uint64_t truxton = truxton_file_get_truxton( file );
truxton_message_set_truxton( message, truxton );
// Now populate the message with this file's data
char temp_string[ MAX_PATH ];
truxton_file_get_media_id( file, temp_string, sizeof( temp_string ) );
truxton_message_set_media_id( message, temp_string );
truxton_file_get_id( file, temp_string, sizeof( temp_string ) );
truxton_message_set_file_id( message, temp_string );
truxton_file_get_parent_id( file, temp_string, sizeof( temp_string ) );
truxton_message_set_parent_file_id( message, temp_string );
truxton_file_get_depot_id( file, temp_string, sizeof( temp_string ) );
truxton_message_set_depot_id( message, temp_string );
truxton_file_get_depot_name( file, temp_string, sizeof( temp_string ) );
truxton_message_set_depot_filename( message, temp_string );
truxton_file_get_hash( file, temp_string, sizeof( temp_string ) );
truxton_message_set_hash( message, temp_string );
truxton_message_set_depot_offset( message, file_get_depot_offset( file ) );
truxton_message_set_depot_length( message, file_get_depot_length( file ) );
truxton_message_set_signature( message, file_get_signature( file ) );
truxton_message_set_file_type( message, file_get_type( file ) );
truxton_message_set_route_id( message, MY_CUSTOM_ROUTE );
truxton_route_message( truxton, message );
truxton_message_destroy( message );
}