user3029: I'm looking to write a custom Ardor bundler to only bundle transactions that have the following properties:

Bundle transactions that are being sent to a specific account only.
Bundle transactions where the sender holds a specific type of asset or monetary system coin.
Bundle transactions only if that user hasn't sent more than 10 transactions in the past hour. 

I couldn't find any code snippets of how to go about setting these custom Ardor bundlers. 

user9301: Take a look at the bundler filter shipped with Ardor: src/java/nxt/addons/AccountPropertyBundler.java and PersonalBundler.java
You need to be familiar with internal Ardor interfaces in order to write your own bundler filter.  The bundler filter runs as part of the server and is loaded during server initialization.  
You specify a custom bundler in nxt.properties by setting nxt.bundlingFilter.

user51095: Here's a simple code snippet which allows you to bundle transactions if the recipients have the asset you specified in their account.

package nxt.customfilter;

import nxt.account.Account;
import nxt.blockchain.Bundler;
import nxt.blockchain.ChildTransaction;
import nxt.db.DbIterator;
import nxt.ae.Asset;


public class FilterByAsset implements Bundler.Filter {

    @Override
    public boolean ok(Bundler bundler, ChildTransaction childTransaction) {
        String assetID = "Insert Your Asset ID Here";
        try (DbIterator iterateAssets = Account.getAccountAssets(childTransaction.getRecipientId(),0,Integer.MAX_VALUE)) {
            while (iterateAssets.hasNext()) {
                if(iterateAssets.next().toString().contains(assetID)) return true;
            }
        }
        return false;
    }
}


customfilter is a folder I created inside src/java/nxt
So you would create a file and name it FilterByAsset.java inside customfilter and paste the above codes.
finally, add nxt.bundlingFilter=nxt.customfilter.FilterByAsset to conf/nxt.properties and compile.
getAccountAssets method return all the assets in the recipient account and prints out accound_id, asset_id, quantity, and unconfirmedQuantity.

3029: <p>I'm looking to write a custom Ardor bundler to only bundle transactions that have the following properties:</p>

<ul>
<li>Bundle transactions that are being <em>sent to</em> a specific account only.</li>
<li>Bundle transactions where the sender holds a specific type of asset or monetary system coin.</li>
<li>Bundle transactions only if that user hasn't sent more than 10 transactions in the past hour. </li>
</ul>

<p>I couldn't find any code snippets of how to go about setting these custom Ardor bundlers. </p>
 9301: <p>Take a look at the bundler filter shipped with Ardor: src/java/nxt/addons/AccountPropertyBundler.java and PersonalBundler.java</p>

<p>You need to be familiar with internal Ardor interfaces in order to write your own bundler filter.  The bundler filter runs as part of the server and is loaded during server initialization.  </p>

<p>You specify a custom bundler in nxt.properties by setting nxt.bundlingFilter.</p>
 51095: <p>Here's a simple code snippet which allows you to bundle transactions if the recipients have the asset you specified in their account.</p>

<pre>
package nxt.customfilter;

import nxt.account.Account;
import nxt.blockchain.Bundler;
import nxt.blockchain.ChildTransaction;
import nxt.db.DbIterator;
import nxt.ae.Asset;


public class FilterByAsset implements Bundler.Filter {

    @Override
    public boolean ok(Bundler bundler, ChildTransaction childTransaction) {
        String assetID = "Insert Your Asset ID Here";
        try (DbIterator iterateAssets = Account.getAccountAssets(childTransaction.getRecipientId(),0,Integer.MAX_VALUE)) {
            while (iterateAssets.hasNext()) {
                if(iterateAssets.next().toString().contains(assetID)) return true;
            }
        }
        return false;
    }
}

</pre>

<p><strong>customfilter</strong> is a folder I created inside <strong>src/java/nxt</strong></p>

<p>So you would create a file and name it <strong><em>FilterByAsset.java</em></strong> inside <strong>customfilter</strong> and paste the above codes.</p>

<p>finally, add <code>nxt.bundlingFilter=nxt.customfilter.FilterByAsset</code> to conf/nxt.properties and compile.</p>

<p><strong>getAccountAssets</strong> method return all the assets in the recipient account and prints out accound_id, asset_id, quantity, and unconfirmedQuantity.</p>
