Invoking Services via a Trigger
Overview
Triggers in Martini automatically invoke services when specific events occur, enabling event-driven services without manual intervention. This powerful automation capability helps you build responsive applications that react to file changes, incoming messages, scheduled times, or HTTP requests.
What You Will Learn
- Available Trigger Types you can use to invoke services and when to use them
- Step-by-step process for adding triggers to your Martini package
- Configuration requirements for different trigger types
- Best practices for trigger-based service invocation
When To Use This
Use triggers when you need to automatically start services based on external events or conditions:
- Start a service automatically in response to events, schedules, or incoming messages
- Integrate external systems or services to trigger Martini services
Prerequisites
- Martini Designer installed and running on your system
- Create a Martini Package
- Create a New service
Supported Martini Trigger Types For Services
Martini supports several trigger node types for invoking services, each designed for specific automation scenarios and event sources.
Visit each trigger's documentation page to learn more about its setup and configuration in detail.
Message Broker Integration Triggers
Start services automatically when messages arrive from external broker systems or message queues.
- AWS SQS Listener Trigger - Process messages from Amazon Simple Queue Service
- JMS Trigger - Handle Java Message Service broker messages
- Kafka Trigger - React to Apache Kafka stream events
- Redis Pub/Sub Trigger - Process Redis publish/subscribe messages
File System and Directory Monitoring Triggers
Start services when files or directories change, enabling automated file processing services.
- Directory Watcher Trigger - Monitor local directories for file changes
- FTP Client Trigger - Poll FTP servers for new files
- FTP Server Trigger - React to files uploaded to your FTP server
HTTP Request and Web Integration Triggers
Start services based on incoming HTTP requests and web-based interactions.
- HTTP Filter Trigger - Process HTTP requests with custom filtering logic
- URL Alias Trigger - Map specific URLs to service execution
Communication and Messaging Triggers
Start services when receiving external communications like emails or instant messages.
- Email Trigger - Process incoming email messages automatically
- XMPP Trigger - Handle instant messaging protocol communications
Data Change and Subscription Monitoring Triggers
Start services when new data becomes available or subscription sources update.
- RSS Trigger - Monitor RSS feeds for new content updates
- MongoDB Listener Trigger - React to MongoDB database changes
Time-Based and Scheduled Execution Triggers
Start services on predetermined schedules or time-based intervals.
- Scheduler Trigger - Execute services on cron-like schedules
Transaction Recovery and Error Handling Triggers
Start services to retry failed transactions or address system errors by reprocessing documents.
- Tracker Resubmit Trigger - Retry failed transactions by resubmitting Tracker documents based on their type and state
Adding Service Triggers to Your Martini Package
Service Triggers enable automatic service invocation when specific conditions are met. Follow these steps to add triggers to your Martini package.
Getting Started with Trigger Creation
To invoke services via triggers, you must add a Service Trigger within the package containing your target services.
- In your Martini Package Navigator, right-click Service Triggers
- Hover over New, then select Trigger from the context menu
- The Create a Trigger dialog box opens with configuration options
Expected result: The trigger creation dialog displays with package, type, and name fields ready for configuration.
Trigger Creation Configuration Properties
Configure these essential properties when creating your trigger:
| Property | Example Value | What It Controls |
|---|---|---|
| Package | mypackage |
Target package location (verify and change if needed) |
| Type | Scheduler Trigger |
Trigger type determining activation conditions and behavior |
| Name | DailyDataSync |
Descriptive identifier for the trigger in your package |
How Trigger Configuration and Service Binding Works
After creating your trigger, Martini automatically opens the configuration interface where you specify which service to invoke and define trigger-specific settings.
- Service Selection: Click the Browse button next to the Service field
- Service Binding: Select the service you want to execute when the trigger activates
- Configuration: Add trigger-specific settings (varies by trigger type - visit individual trigger documentation for detailed configuration options. See Supported Martini Trigger Types For Services)
- Save your trigger configuration using Ctrl + S or the save icon
- Start the trigger using the Start button on the toolbar on the top right
Expected result: Your configured trigger appears under Service Triggers in the Navigator, ready to automatically invoke your selected service when the configured conditions are met.
Trigger Configuration Benefits and Use Cases
Trigger-based service invocation eliminates manual service execution and enables true automation. By configuring triggers properly, you create responsive systems that handle events without human intervention, improving efficiency and reducing operational overhead.
Common automation scenarios include processing uploaded files immediately, responding to API requests in real-time, running scheduled maintenance tasks, and handling message queue processing automatically.
Troubleshooting
Common issues when configuring and using service triggers in Martini packages.
| Problem | Detection | Cause | Fix | Affected Versions |
|---|---|---|---|---|
| Trigger not appearing in list | Service Triggers folder shows empty | Wrong package selected | Verify package selection in creation dialog | All versions |
| Service not executing | Trigger conditions met but no service runs | Service binding not configured | Click Browse and select target service | All versions |
| Save operation fails | Cannot save trigger configuration | Missing required configuration | Complete all required fields before saving | All versions |
Helpful Resources
- Triggers Overview - Complete reference for all available trigger types
- Services - Understanding service components and structure
- Creating Martini Packages - Package management fundamentals
- Community Q&A: Martini Community
Have a Question? Post or search it here.